home *** CD-ROM | disk | FTP | other *** search
/ Magazyn WWW 1999 April / cd24-www.iso / prog / mac / snak / snak.hqx / Snak 2.0.2 / Scripts / purepak.irc < prev    next >
Text File  |  1998-07-11  |  104KB  |  3,357 lines

  1.  
  2. #Kent Sorensen 07/11 modified to print out disclaimer about the unsupported language features
  3. #Also removed the LC lagcheck becuse Snak doesn't support event handlers yet...
  4. #
  5. # ########################################################################## #
  6. #                      PurePak - The sequel to TextBox                       #
  7. #                          A -+ TEXT +- production                           #
  8. # ########################################################################## #
  9. # Author: Crypt Keeper [ckeeper@axiom.access.one.net] (CKeeper on IRC)
  10. # Version 2.07
  11. #
  12. # This script requires at least ircII2.2.9 (Unix) or a fully ircII compatible
  13. # client.  It has only been tested under Unix with ircII2.2.9 and ircII2.8.2.
  14. #
  15. # If you edit this file, you must edit it with a Unix text editor or use
  16. # utilities like dos2unix/unix2dos to convert it to DOS to edit and then
  17. # back to Unix.  If it is edited in a DOS text editor it will be corrupted.
  18. #
  19. # All stolen code is labelled.  If it isn't labelled as stolen code, then it
  20. # is mine.  If you take my code, please give me credit.
  21. #
  22. # PurePak version 2.07 IRC script
  23. # Copyright (C) 1995
  24. #
  25. # This program is free software; you can redistribute it and/or modify
  26. # it under the terms of the GNU General Public License as published by
  27. # the Free Software Foundation; either version 1, or (at your option)
  28. # any later version.
  29. #
  30. # This program is distributed in the hope that it will be useful,
  31. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  32. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  33. # GNU General Public License for more details.
  34. #
  35. # You should have received a copy of the GNU General Public License
  36. # along with this program; if not, write to the Free Software
  37. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  38. # ########################################################################## #
  39.  
  40. ^set novice off
  41. ^set exec_protection off
  42. ^set input_protection off
  43. @ PPVERS = [2.07]
  44.  
  45. # ----------------------------------------------------------------------------
  46. # Sets and key bindings
  47. # ----------------------------------------------------------------------------
  48.  
  49. # See if we're on an EPIC client
  50. EVAL ^if (match(*EPIC* $status_user)) {@ PP.EPIC = 1}
  51.  
  52. EVAL ^set input_prompt [PurePak] version $PPVERS loading...
  53.  
  54. ^set tab on
  55. ^set tab_max 6
  56. ^set send_ignore_msg off
  57. ^set clock_24hour off
  58. ^set clock on
  59. ^set status_away  (away)
  60. ^set user_information [PurePak]
  61. ^set status_user [Lag ??] [PurePak] *
  62. ^set status_query  [Query: %Q]
  63. ^set status_notify  [Activity: %F]
  64. ^set status_oper *
  65. ^set status_overwrite  (overtype)
  66. ^set status_window ^^^^^^^^
  67. ^set status_mode  (+%+)
  68. ^set status_mail  [Mail: %M]
  69. ^set status_server  via %S
  70. ^set channel_name_width 10
  71. ^set debug 0
  72. ^set help_window off
  73. ^set help_prompt on
  74. ^set hold_mode_max 0
  75. ^set input_aliases off
  76. ^set insert_mode on
  77. ^set lastlog 16384
  78. ^set lastlog_level all
  79. ^set scroll on
  80. ^set scroll_lines 1
  81. ^set shell_limit 0
  82. ^set status_hold_lines  (%B)
  83. ^set command_mode off
  84. ^set double_status_line off
  85. ^set suppress_server_motd off
  86. ^set show_end_of_msgs off
  87. ^set beep_when_away 0
  88. EVAL ^set client_information [PurePak] v$PPVERS by Crypt Keeper
  89. ^set status_hold  -- ENTER --
  90. ^set beep_max 2
  91. ^set warn_of_ignores on
  92. ^set verbose_ctcp off
  93. ^set indent on
  94. ^set auto_whowas off
  95. ^set full_status_line on
  96. ^set continued_line  
  97. ^set hide_private_channels off
  98. ^set show_away_once on
  99. ^set history 120
  100. ^set auto_unmark_away off
  101. ^set beep_on_msg NONE
  102. ^set show_channel_names on
  103. ^set show_numerics off
  104. ^set max_recursions 210
  105. ^set log off
  106. ^set logfile irc.log
  107. ^set input_protection off
  108. ^set dcc_block_size 1024
  109. ^set no_ctcp_flood on
  110. ^EVAL ^if ([$mail] == [0]) {^set mail 1}
  111. ^EVAL ^set load_path ~/purepak:./purepak:~:$load_path
  112. ^set hold_mode off
  113. ^set notify_on_termination off
  114. ^set show_who_hopcount off
  115. ^set flood_warning off
  116. ^set flood_rate 1
  117. ^set flood_after 4
  118. ^set flood_users 4
  119. ^EVAL ^set status_format %T %*%@%N%#%Q%S%H%B%A%C%+%I%O%F %W%>%U%M%X%Y%Z 
  120.  
  121. bind ^X meta2
  122. bind ^\ switch_channels
  123. bind ^Q quote_character
  124. bind ^I parse_command ^tk.getmsg 1 $tk.msglist
  125. bind ^R parse_command ^tk.getmsg -1 $tk.msglist
  126. bind ^X^X parse_command tk.delnick
  127. bind ^S toggle_stop_screen
  128. bind ^[ meta1
  129. bind meta1-[ meta2
  130. bind meta1-O meta2
  131. bind meta2-^@ scroll_end
  132. bind meta2-A backward_history
  133. bind meta2-B forward_history
  134. bind meta2-C forward_character
  135. bind meta2-D backward_character
  136. bind meta2-5 parse_command ^s_up
  137. bind meta2-6 parse_command ^s_dn
  138. bind meta2-1 parse_command ^s_end
  139. bind meta2-7 parse_command ^s_end
  140. bind ^X^A scroll_backward
  141. bind ^X^B scroll_forward
  142. bind ^B self_insert
  143. bind ^_ self_insert
  144. bind ^V self_insert
  145. bind ^A self_insert
  146. bind ^O self_insert
  147. bind ^W next_window
  148. bind ^Z stop_irc
  149. bind ^U erase_line
  150.  
  151. alias s_up {
  152.     ^bind ~ nothing
  153.     ^type ^U^X^A^U
  154.     ^timer 1 ^bind ~ self_insert
  155. }
  156. alias s_dn {
  157.     ^bind ~ nothing
  158.     ^type ^U^X^B^U
  159.     ^timer 1 ^bind ~ self_insert
  160. }
  161. alias s_end {
  162.     ^bind ~ nothing
  163.     ^type ^[[^@
  164.     ^timer 1 ^bind ~ self_insert
  165. }
  166.  
  167. # File that settings are saved to
  168. @ PP.SAVEFILE = [purepak.sav]
  169.  
  170. on ^dcc_raw * {}
  171.  
  172. # ----------------------------------------------------------------------------
  173. # Tab key message history (originally from the ircII tabkey script)
  174. # ----------------------------------------------------------------------------
  175.  
  176. alias tk.addmsg {
  177.     @ tk.matched = rmatch($0 $^\1-)
  178.     if (tk.matched)
  179.     {
  180.         @ tk.msglist = [$(0-${tk.matched-1}) $(${tk.matched+1}-)]
  181.     }
  182.     { @ tk.msglist = [$(0-${tk.msgmax-1})] }
  183.     @ tk.msgcnt = 0
  184.     ^assign -tk.matched
  185. }
  186. alias tk.getmsg {
  187.     @ tk.msgcnt = tk.msgcnt + [$0]
  188.     if ( #tk.msglist < tk.msgcnt ) {@ tk.msgcnt = 1}
  189.     if (tk.msgcnt <= 0) {@ tk.msgcnt =  #tk.msglist}
  190.     @ tk.junk = K ## [msg]
  191.     type ^U$tk.junk $^^{[$($tk.msgcnt)]} 
  192. }
  193. alias tk.delnick {
  194.     if (tk.msgcnt == 0)
  195.     {
  196.         echo *** Nickname: $word(0 $tk.msglist) removed.
  197.         @ tk.msglist = [$notword(1 $tk.msglist)]
  198.     }
  199.     {
  200.         echo *** Nickname: $word(${tk.msgcnt-1} $tk.msglist) removed.
  201.         @ tk.msglist = [$notword($tk.msgcnt $tk.msglist)]
  202.     }
  203.     type ^U
  204. }
  205. alias notword {
  206.     if ([$0]>0)
  207.     {
  208.         if (([$0]>1)&&([$0] < rmatch($~ $1-))) {@ nw.sep = [ ]} {@ nw.sep = []}
  209.         @ function_return = [$(1-${[$0]-1})] ## [$nw.sep] ## [$(${[$0]+1}-)]
  210.     } {@ function_return = [$1-]}
  211. }
  212. alias minnot {
  213.     @ noticecnt = 0
  214.     ^assign -lastnoter
  215.     ^assign -ntemp
  216. }
  217.  
  218. # ----------------------------------------------------------------------------
  219. # Miscellaneous functions and aliases, mostly internal
  220. # ----------------------------------------------------------------------------
  221.  
  222. # Lame aliases for buggy clients
  223. alias say {
  224.     quote PRIVMSG $C :$*
  225.     echo <${N}> $*
  226. }
  227. alias sendto {
  228.     if (ischannel($0)) {^if ([$0] == C) {/echo <${N}> $1-} {/echo -> $0 <${N}> $1-}} {/echo -> [$0] $1-}
  229.     ^quote PRIVMSG $0 :$1-
  230. }
  231.  
  232. # /me alias that echoes to the right window (some clients don't)
  233. alias me {
  234.     xecho -LEVEL CRAP -WINDOW $winnum() * $N $*
  235.     quote PRIVMSG $C :ACTION $*
  236. }
  237.  
  238. # Repeats $1 $0 times
  239. alias repeatcmd {
  240.     @ RCOUNT = 0
  241.     while (RCOUNT < [$0])
  242.     {
  243.         @ RCOUNT = RCOUNT + 1
  244.         $1-
  245.     }
  246.     ^assign -RCOUNT
  247. }
  248.  
  249. alias nickonly {@ FUNCTION_RETURN = left($index(! $0) $0)}
  250. alias safestr {@ FUNCTION_RETURN = strip(\;\$ $*)}
  251.  
  252. # Returns 1 if you have ops on $0, 0 if you don't.  We use an alias instead
  253. # of ischanop() since ischanop doesn't always return a correct result on
  254. # older clients, and if ischanop were to say that you are not opped when you
  255. # really are, your protection stuff wouldn't go off.
  256. alias gotops {
  257.     @ FUNCTION_RETURN = 0
  258.     if ([$0] == C) {^if (P == [@]) {@ FUNCTION_RETURN = 1}}
  259.     {^if (ischanop($N $0)) {@ FUNCTION_RETURN = 1}}
  260. }
  261.  
  262. # Returns a random letter/number string
  263. @ PP.RC = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789a]
  264. alias randcrap {
  265.     @ RC = 1
  266.     while (RC < [$0])
  267.     {
  268.         @ RC = RC + 1
  269.         @ RS = mid($rand(62) 1 $PP.RC)##RS
  270.     }
  271.     @ RS = mid($rand(25) 1 $PP.RC)##RS
  272.     @ FUNCTION_RETURN = RS
  273.     ^assign -RS
  274.     ^assign -RC
  275. }
  276.  
  277. # Returns true if a string contains letters
  278. alias isalpha {
  279.     if (rmatch($0 *a* *b* *c* *d* *e* *f* *g* *h* *i* *j* *k* *l* *m* *n* *o* *p* *q* *r* *s* *t* *u* *v* *w* *x* *y* *z*)) {@ FUNCTION_RETURN = 1}
  280.     {@ FUNCTION_RETURN = 0}
  281. }
  282.  
  283. # delword <word> <list> (output returned in NLIST)
  284. # recursive alias that deletes a word from a list
  285. alias delword {
  286.     if ([$1] != [$0]) {^assign NLIST $1 $NLIST}
  287.     if ([$2]) {^delword $0 $2-}
  288. }
  289.  
  290. # Check is user is friended/shitted
  291. # ispal/isshit <n!u@h> <#channel>
  292. alias ispal {
  293.     @ FUNCTION_RETURN = 0
  294.     foreach PP.FRIENDS XZ {
  295.         if (match($decode($XZ) $1))
  296.         {
  297.             if (rmatch($0 $PP.FRIENDS[$XZ])) {@ FUNCTION_RETURN = 1}
  298.         }
  299.     }
  300.     ^assign -XZ
  301. }
  302. alias isshit {
  303.     @ FUNCTION_RETURN = 0
  304.     foreach PP.ENEMIES XZ {
  305.         if (match($decode($XZ) $1))
  306.         {
  307.             if (rmatch($0 $PP.ENEMIES[$XZ])) {@ FUNCTION_RETURN = 1}
  308.         }
  309.     }
  310.     ^assign -XZ
  311. }
  312.  
  313. # The pager for long displays, such as in help.
  314. # We do it like this so it doesn't use the old $"-MORE-" method
  315. # which is outdated and causes problems on newer clients.
  316. alias pp.pauseset {
  317.     @ ECCTR = 0
  318.     ^alias echo {
  319.         @ EC[$ECCTR] = [$*]
  320.         @ ECCTR = ECCTR + 1
  321.     }
  322. }
  323. alias pp.pauseend {
  324.     ^alias -echo
  325.     @ ECTR = 0
  326.     ^pp.doechos
  327. }
  328. alias pp.doechos {
  329.     @ LCTR = 0
  330.     while ((ECTR < ECCTR)&&(LCTR < PP.SET.NUMLINES))
  331.     {
  332.         @ LCTR = LCTR + 1
  333.         echo $EC[$ECTR]
  334.         ^assign -EC[$ECTR]
  335.         @ ECTR = ECTR + 1
  336.     }
  337.     if ((LCTR >= PP.SET.NUMLINES)&&(ECTR < ECCTR)) {^input "** Press ENTER to continue **" ^pp.doechos}
  338.     {
  339.         ^assign -LCTR
  340.         ^assign -ECTR
  341.         ^assign -ECCTR
  342.         foreach EC AA {^assign -EC[$AA]}
  343.     }
  344. }
  345.  
  346. # ----------------------------------------------------------------------------
  347. # Default settings if purepak.sav doesn't exist
  348. # ----------------------------------------------------------------------------
  349.  
  350. # Letters in main settings variable (PP.SET): (this variable is about full)
  351. #   I - Auto-ignore on msg/notice/ctcp floods
  352. #   F - Flood filtering
  353. #   A - Ascii art kicker
  354. #   N - Nick flood protection
  355. #   E - Use enemies list
  356. #   L - Use friends list
  357. #   O - Let everyone know when you are set away
  358. #   G - Log messages and important stuff while away
  359. #   W - Send notices and/or warnings to people
  360. #   J - Auto rejoin on kick
  361. #   M - Mass deop/kick protection
  362. #   K - Channel key flash protection
  363. #   B - Ban protection
  364. #   X - Ignore CTCP PING
  365. #   Y - Ignore CTCP VERSION
  366. #   Z - Ignore CTCP FINGER
  367. #   S - Automatic deop on server ops
  368. #   H - Write awaylog to a file (PP.SET.ALFILE)
  369. #   C - Clonebot mass-join protection
  370. #   Q - Beep on private messages
  371. #   P - Auto-unload help
  372. #   V - Desynched user notification
  373. @ PP.SET = [CGFENLOWJMKBZPV]
  374.  
  375. # Response to mass deop/kick (0 = deop, 1 = kick)
  376. @ PP.SET.MASSRESP = 0
  377. # Auto-ignoring - number of seconds to autoignore
  378. @ PP.SET.IGSECS = 30
  379. # Short kill notice displays
  380. @ PP.SET.SHORTKILLS = 1
  381. # Server notice settings
  382. @ PP.SET.NOTELEVELS = [KUFNMC]
  383. # Nick flood protection sensitivity
  384. @ PP.SET.NFSENS = 3
  385. # Length of the first word in a message for it to be a junkflood
  386. @ PP.SET.JFLEN = 200
  387. # Away log file
  388. @ PP.SET.ALFILE = [away.log]
  389. # Exec commands to do various things
  390. @ PP.SET.FINGERCMD = [finger]
  391. @ PP.SET.LSCMD = [ls -l]
  392. @ PP.SET.LSWCMD = [ls -xp]
  393. @ PP.SET.RMCMD = [rm -f]
  394. @ PP.SET.MAILCMD = [mail]
  395. @ PP.SET.UUECMD = [uuencode]
  396. @ PP.SET.CATCMD = [cat]
  397. @ PP.SET.PSCMD = [ps -uxw]
  398. @ PP.SET.KILLCMD = [kill -KILL]
  399. @ PP.SET.UNGZCMD = [gunzip -c]
  400. @ PP.SET.UNZCMD = [uncompress -c]
  401. @ PP.SET.MKNODCMD = [mknod]
  402. @ PP.SET.NSLOOKCMD = [host]
  403. # Counter variable for awaylog
  404. @ PP.AWAYLCTR = 0
  405. # Minutes of idle-time to be set auto-away (0 disables)
  406. @ PP.SET.AUTOAWAY = 0
  407. # Clonebot mass-join sensitivity (number that must join in a 4 second span
  408. @ PP.SET.CPSENS = 3
  409. # NSLOOKUP on join for IP addresses
  410. @ PP.SET.LOOKJOIN = 1
  411. # Counter for clonebot mass-join detector
  412. @ PP.CPCTR = 0
  413. # Number of lines of output before a pause on help, playback, etc.
  414. @ PP.SET.NUMLINES = 22
  415. # Scripts we should auto-load:
  416. # K = Kicks, X = DCC, B = Bots, S = Silly, W = War
  417. @ PP.SET.AUTOLOAD = [XBS]
  418. # This is set to 1 after the first motd is seen
  419. @ PP.SEENMOTD = 0
  420. # Msg/notice formats
  421. @ PP.SET.MRFORMAT = encode([N!U] M)
  422. @ PP.SET.NRFORMAT = encode(-N- M)
  423. @ PP.SET.MSFORMAT = encode(-> [N] M)
  424. @ PP.SET.NSFORMAT = encode(-> -N- M)
  425. # Channel protection
  426. @ PP.SET.CHANPROT = 1
  427. # Show people as they signoff in splits
  428. @ PP.SET.SHOWSPLITTERS = 0
  429. # Suppress startup messages
  430. @ PP.SET.NOSTARTUP = 0
  431. # Insert random ?'s into bans
  432. @ PP.SET.FUNKYBANS = 1
  433. # Beep on netsplits
  434. @ PP.SET.BSP = 1
  435. # Allow CTCP PAGE
  436. @ PP.SET.CTCPPAGE = 1
  437. # Print time every 10 minutes
  438. @ PP.SET.TP = 0
  439. # Nick to match public
  440. @ PP.SET.PMATCH = [.]
  441.  
  442. # Msg/notice format settings to look like other scripts
  443. @ PP.MR.DEFAULT = encode([N!U] M)
  444. @ PP.MS.DEFAULT = encode(-> [N] M)
  445. @ PP.NR.DEFAULT = encode(-N- M)
  446. @ PP.NS.DEFAULT = encode(-> -N- M)
  447. @ PP.MR.IRCII = encode(*N* M)
  448. @ PP.MS.IRCII = encode(-> *N* M)
  449. @ PP.NR.IRCII = encode(-N- M)
  450. @ PP.NS.IRCII = encode(-> -N- M)
  451. @ PP.MR.TEXTBOX = encode(*N* M)
  452. @ PP.MS.TEXTBOX = encode(-> *N* M)
  453. @ PP.NR.TEXTBOX = encode(-N- M)
  454. @ PP.NS.TEXTBOX = encode(-> -N- M)
  455. @ PP.MR.LICE = encode([N!U] M)
  456. @ PP.MS.LICE = encode([*N*] M)
  457. @ PP.NR.LICE = encode(-N!U- M)
  458. @ PP.NS.LICE = encode([-N-] M)
  459. @ PP.MR.PHOENIX = encode([N:U] M)
  460. @ PP.MS.PHOENIX = encode(<-[N]-> M)
  461. @ PP.NR.PHOENIX = encode(-N- M)
  462. @ PP.NS.PHOENIX = encode(-> -N- M)
  463.  
  464. # ----------------------------------------------------------------------------
  465. # /pp alias to set script options
  466. # ----------------------------------------------------------------------------
  467.  
  468. # Other script parts (the pp-*.irc scripts) can add to this array and have
  469. # their settings under /pp
  470. @ PP.SETCHECKS.M = [^pp.set.m]
  471.  
  472. alias pp.set.bstatus {^if ([$0]) {@ FUNCTION_RETURN = [ON ]} {@ FUNCTION_RETURN = [OFF]}}
  473. alias pp.set.tstatus {^if (index($0 $PP.SET) >= 0) {@ FUNCTION_RETURN = [ON ]} {@ FUNCTION_RETURN = [OFF]}}
  474. alias pp.set.changetoggle {
  475.     if ([$1])
  476.     {
  477.         if ([$1] == [OFF]) {@ PP.SET = strip($0 $PP.SET)}
  478.         {^if (index($0 $PP.SET) < 0) {@ PP.SET = [$0]##PP.SET}}
  479.     }
  480. }
  481. alias pp.set.setupctcp {
  482.     if (index(X $PP.SET) < 0) {^on raw_irc - "% PRIVMSG % :**PING**"} {^on ^raw_irc "% PRIVMSG % :**PING**" {}}
  483.     if (index(Y $PP.SET) < 0) {^on raw_irc - "% PRIVMSG % :**VER**"} {^on ^raw_irc "% PRIVMSG % :**VER**" {}}
  484.     if (index(Z $PP.SET) < 0) {^on raw_irc - "% PRIVMSG % :**FINGER**"} {^on ^raw_irc "% PRIVMSG % :**FINGER**" {}}
  485. }
  486. alias pp.set.onoff {^if ([$0]) {@ FUNCTION_RETURN = [ON]} {@ FUNCTION_RETURN = [OFF]}}
  487.  
  488. alias status {
  489.     ^pp.pauseset
  490.     echo -- Current PurePak settings:
  491.     echo -- ===========================================================================
  492.     echo -- Automatic flood ignoring (AIGnore)                      : $pp.set.tstatus(I)
  493.     echo -- Filtering of known floods (FFILTer)                     : $pp.set.tstatus(F)
  494.     echo -- ASCII art kicker (ARTKick)                              : $pp.set.tstatus(A)
  495.     echo -- Kicking on kick flood (NFProt)                          : $pp.set.tstatus(N)
  496.     echo -- Use of enemies list (ENEMies)                           : $pp.set.tstatus(E)
  497.     echo -- Use of friends list (FRIends)                           : $pp.set.tstatus(L)
  498.     echo -- Public announcement of away status (AWAYNotices)        : $pp.set.tstatus(O)
  499.     echo -- Logging of msgs/events while away (AWAYLogging)         : $pp.set.tstatus(G)
  500.     echo -- Logging to an away log file (AWAYWriting)               : $pp.set.tstatus(H)
  501.     echo -- Name of away log file (AFILE)                           : ${PP.SET.ALFILE}
  502.     echo -- General miscellaneous warnings/notices (NOTIces)        : $pp.set.tstatus(W)
  503.     echo -- Automatic rejoining on kick (KREJoin)                   : $pp.set.tstatus(J)
  504.     echo -- Mass deop/kick protection (MASSProt)                    : $pp.set.tstatus(M)
  505.     if (PP.SET.MASSRESP) {
  506.     echo -- Action taken on mass deop/kick (MASSAction)             : KICK
  507.     } {
  508.     echo -- Action taken on mass deop/kick (MASSAction)             : DEOP
  509.     }
  510.     echo -- Channel protection (CHANprot)                           : $pp.set.onoff($PP.SET.CHANPROT)
  511.     echo -- Automatic removal of server ops (SERVOP)                : $pp.set.tstatus(S)
  512.     echo -- Channel key flash protection (KEYProt)                  : $pp.set.tstatus(K)
  513.     echo -- Ban defense (BANDefense)                                : $pp.set.tstatus(B)
  514.     echo -- Ignoring of CTCP PINGs (PING)                           : $pp.set.tstatus(X)
  515.     echo -- Ignoring of CTCP FINGERs (FINGer)                       : $pp.set.tstatus(Z)
  516.     echo -- Ignoring of CTCP VERSIONs (VERsion)                     : $pp.set.tstatus(Y)
  517.     echo -- Seconds to auto-ignore flooders (IGTime)                : ${PP.SET.IGSECS}
  518.     echo -- Nick flood protection sensitivity (NFSens)              : ${PP.SET.NFSENS}
  519.     echo -- Length of first word for a msg to be junkflood (JFLEN)  : ${PP.SET.JFLEN}
  520.     echo -- Desynched user notification (DESynchnote)               : $pp.set.tstatus(V)
  521.     echo -- Beeping on private messages (MSGBeep)                   : $pp.set.tstatus(Q)
  522.     if (PP.SET.AUTOAWAY) {
  523.     echo -- Minutes of idle time before being set away (AUTOAway)   : ${PP.SET.AUTOAWAY}
  524.     } {
  525.     echo -- Minutes of idle time before being set away (AUTOAway)   : OFF
  526.     }
  527.     echo -- NS lookup of IP adresses on join                        : $pp.set.onoff($PP.SET.LOOKJOIN)
  528.     echo -- Clonebot mass-join protection (CLONEProt)               : $pp.set.tstatus(C)
  529.     echo -- Clonebot mass-join protection sensitivity (CLONESens)   : ${PP.SET.CPSENS}
  530.     if (suppress_server_motd == [ON])
  531.     {
  532.     echo -- Server motd display at startup (MOTD)                   : OFF
  533.     } {
  534.     echo -- Server motd display at startup (MOTD)                   : ON
  535.     }
  536.     echo -- Show users who join/signoff in splits (SHOWSPLITters)   : $pp.set.onoff($PP.SET.SHOWSPLITTERS)
  537.     echo -- Number of rows on this display (ROWS)                   : ${PP.SET.NUMLINES + 2}
  538.     echo -- Auto-loading of pp-bots.irc (LOADBots)                  : $pp.set.sload(B)
  539.     echo -- Auto-loading of pp-xdcc.irc (LOADXdcc)                  : $pp.set.sload(X)
  540.     echo -- Auto-loading of pp-silly.irc (LOADSilly)                : $pp.set.sload(S)
  541.     echo -- Auto-loading of pp-war.irc (LOADWar)                    : $pp.set.sload(W)
  542.     echo -- Auto-loading of pp-kicks.irc (LOADKicks)                : $pp.set.sload(K)
  543.     echo -- Suppression of script startup screens                   : $pp.set.onoff($PP.SET.NOSTARTUP)
  544.     echo -- Insert random ?'s into bans (FUNkybans)                 : $pp.set.onoff($PP.SET.FUNKYBANS)
  545.     echo -- Beep on netsplits (BEEPSPLIT)                           : $pp.set.onoff($PP.SET.BSP)
  546.     echo -- CTCP PAGE (PAGE)                                        : $pp.set.onoff($PP.SET.CTCPPAGE)
  547.     echo -- Print time every 10 minutes (TPRINT)                    : $pp.set.onoff($PP.SET.TP)
  548.     echo -- String to match and highlight in public (PMATCH)        : ${PP.SET.PMATCH}
  549.     echo -- ===========================================================================
  550.     ^pp.pauseend
  551. }
  552.  
  553. alias pp.set.sload {
  554.     if ([$1])
  555.     {
  556.         if ([$1] == [ON])
  557.         {
  558.             if (index($0 $PP.SET.AUTOLOAD) < 0) {@ PP.SET.AUTOLOAD = PP.SET.AUTOLOAD##[$0]}
  559.             pp.autoload
  560.         } {@ PP.SET.AUTOLOAD = strip($0 $PP.SET.AUTOLOAD)}
  561.     } {^if (index($0 $PP.SET.AUTOLOAD) >= 0) {@ FUNCTION_RETURN = [ON]} {@ FUNCTION_RETURN = [OFF]}}
  562. }
  563. alias pp.autoload {
  564.     if ((index(K $PP.SET.AUTOLOAD) >= 0)&&(!(PP.KICKS))) {/load pp-kicks.irc}
  565.     if ((index(B $PP.SET.AUTOLOAD) >= 0)&&(!(PP.BOTS))) {/load pp-bots.irc}
  566.     if ((index(S $PP.SET.AUTOLOAD) >= 0)&&(!(PP.SILLY))) {/load pp-silly.irc}
  567.     if ((index(X $PP.SET.AUTOLOAD) >= 0)&&(!(PP.DCC))) {/load pp-dcc.irc}
  568.     if ((index(W $PP.SET.AUTOLOAD) >= 0)&&(!(PP.WAR))) {/load pp-war.irc}
  569. }
  570.  
  571. alias pp.set.setmformat {
  572.     echo *** Special characters in msg/notice outgoing display formats:
  573.     echo ***   N = Nickname of person you are sending to
  574.     echo ***   M = Text of the message you are sending
  575.     echo ***   T = Current time
  576.     echo *** Special characters in msg/notice incoming display formats:
  577.     echo ***   N = Nickname of the person who sent the msg/notice
  578.     echo ***   U = User@host of sender
  579.     echo ***   M = Text of message
  580.     echo ***   T = Current time
  581.     echo *** ^V,^B,^O,^_ control characters can also be used
  582.     echo ***
  583.     echo *** You may enter new formats for any of these, or press enter for no
  584.     echo *** change.
  585.     echo ***
  586.     echo *** Current incoming message format is: $decode($PP.SET.MRFORMAT)
  587.     ^input "New incoming message format or enter for no change >>" if (1) {
  588.         if ([$0]) {@ PP.SET.MRFORMAT = encode($*)}
  589.         echo *** Current outgoing message format is: $decode($PP.SET.MSFORMAT)
  590.         ^input "New outgoing message format or enter for no change >>" if (1) {
  591.             if ([$0]) {@ PP.SET.MSFORMAT = encode($*)}
  592.             echo *** Current incoming notice format is: $decode($PP.SET.NRFORMAT)
  593.             ^input "New incoming notice format or enter for no chaange >>" if (1) {
  594.                 if ([$0]) {@ PP.SET.NRFORMAT = encode($*)}
  595.                 echo *** Current outgoing notice format is: $decode($PP.SET.NSFORMAT)
  596.                 ^input "New outgoing notice format or enter for no change >>" if (1) {
  597.                     if ([$0]) {@ PP.SET.NSFORMAT = encode($*)}
  598.                     echo ***
  599.                     echo *** Message formats are now set to:
  600.                     echo *** Incoming message: $decode($PP.SET.MRFORMAT)
  601.                     echo *** Outgoing message: $decode($PP.SET.MSFORMAT)
  602.                     echo *** Incoming notice: $decode($PP.SET.NRFORMAT)
  603.                     echo *** Outgoing notice: $decode($PP.SET.NSFORMAT)
  604.                     echo ***
  605.                     echo *** If you have made changes, you must save with /sve for your changes
  606.                     echo *** to become permanent.
  607.                 }
  608.             }
  609.         }
  610.     }
  611. }
  612.  
  613. # *** Main script settings:
  614. # AIGnore = Automatic flood ignoring
  615. # FFILTer = Filtering of known floods
  616. # ARTKick = ASCII art kicker
  617. # NFProt = Kicking on nick flood
  618. # ENEMies = Use of enemies list
  619. # FRIends = Use of friends list
  620. # AWAYNotices = Public announcement of away status
  621. # AWAYLogging = Logging of msgs/events while away
  622. # AWAYWriting = Logging to an away log file
  623. # AFILE = Name of away log file
  624. # NOTIces = General warnings/notices
  625. # KREJoin = Automatic rejoining on kick
  626. # MASSProt = Mass deop/kick protection
  627. # MASSAction = Action taken on mass deop/kick
  628. # SERVOP = Automatic removal of server ops
  629. # KEYProt = Channel key flash protection
  630. # BANDefense = Ban defense
  631. # PING = Ignoring of CTCP PING
  632. # FINGer = Ignoring of CTCP FINGER
  633. # VERsion = Ignoring of CTCP VERSION
  634. # IGTime = Seconds to auto-ignore flooders
  635. # NFSens = Sensitivity of nick flood protection (higher values more sensitive)
  636. # JFLEN = First word length for a message to be a junkflood
  637. # *CMD = Correspond with PP.SET.*CMD above
  638. # MSGBeep = Beep on private messages
  639. # AUTOAway = Minutes of idle-time to be automaticly set away
  640. # CLONEProt = Clonebot mass-join protection
  641. # CLONESens = Sensitivity of clonebot mass-join protection (lower values more sensitive)
  642. # ROWS = Number of rows on display
  643. # LOADBots = Auto load pp-bots.irc
  644. # LOADWar = Auto load pp-war.irc
  645. # LOADSilly = Auto load pp-silly.irc
  646. # LOADKicks = Auto load pp-kicks.irc
  647. # LOADDcc = Auto load pp-dcc.irc
  648. # HELPUnload = Auto unloading of help
  649. # DESynchnote = Desynched user notification
  650. # WRITEMETHOD = /sve write method
  651. # MOTD = Server motd display at startup
  652. # MFORMAT = Msg/notice format settings
  653. # CHANprot = Channel protection
  654. # SHOWSPLITters = Show users who join/signoff in splits
  655. # LOOKJoin = NS lookup of IP adresses on join
  656. # NOSTARTUP = Suppression of startup screens
  657. # FUNkybans = Insert random ?'s into bans
  658. # BEEPSPLIT = Beep on netsplits
  659. # PAGE = CTCP PAGE
  660. # TPRINT = Print time every 10 minutes
  661. # PMATCH = String to match and highlight publicly
  662. alias pp.set.m {
  663.     if (rmatch($0 LOADK* LOADB* LOADW* LOADS* LOADD*))
  664.     {
  665.         if (match($1 ON OFF))
  666.         {
  667.             if (match(LOADB* $0)) {/pp.set.sload B $1}
  668.             if (match(LOADW* $0)) {/pp.set.sload W $1}
  669.             if (match(LOADS* $0)) {/pp.set.sload S $1}
  670.             if (match(LOADK* $0)) {/pp.set.sload K $1}
  671.             if (match(LOADD* $0)) {/pp.set.sload X $1}
  672.         }
  673.         if (match(LOADB* $0)) {/echo *** Auto-loading of pp-bots.irc is now $pp.set.sload(B)}
  674.         if (match(LOADW* $0)) {/echo *** Auto-loading of pp-war.irc is now $pp.set.sload(W)}
  675.         if (match(LOADS* $0)) {/echo *** Auto-loading of pp-silly.irc is now $pp.set.sload(S)}
  676.         if (match(LOADK* $0)) {/echo *** Auto-loading of pp-kicks.irc is now $pp.set.sload(K)}
  677.         if (match(LOADD* $0)) {/echo *** Auto-loading of pp-dcc.irc is now $pp.set.sload(X)}
  678.         @ VU = 1
  679.     }
  680.     if ([$0] == [PAGE])
  681.     {
  682.         if (match($1 ON OFF))
  683.         {
  684.             if ([$1] == [ON]) {@ PP.SET.CTCPPAGE = 1} {@ PP.SET.CTCPPAGE = 0}
  685.         }
  686.         echo *** CTCP PAGE response is now $pp.set.onoff($PP.SET.CTCPPAGE)
  687.         @ VU = 1
  688.     }
  689.     if ([$0] == [TPRINT])
  690.     {
  691.         if (match($1 ON OFF))
  692.         {
  693.             if ([$1] == [ON]) {@ PP.SET.TP = 1} {@ PP.SET.TP = 0}
  694.         }
  695.         echo *** Print time every 10 minutes is now $pp.set.onoff($PP.SET.TP)
  696.         @ VU = 1
  697.     }
  698.     if ([$0] == [BEEPSPLIT])
  699.     {
  700.         if (match($1 ON OFF))
  701.         {
  702.             if ([$1] == [ON]) {@ PP.SET.BSP = 1} {@ PP.SET.BSP = 0}
  703.         }
  704.         echo *** Beep on netsplits is now $pp.set.onoff($PP.SET.BSP)
  705.         @ VU = 1
  706.     }
  707.     if (match(LOOKJ* $0))
  708.     {
  709.         if (match($1 ON OFF))
  710.         {
  711.             if ([$1] == [ON]) {@ PP.SET.LOOKJOIN = 1} {@ PP.SET.LOOKJOIN = 0}
  712.         }
  713.         echo *** NS lookup of IP adresses on join is now $pp.set.onoff($PP.SET.LOOKJOIN)
  714.         @ VU = 1
  715.     }
  716.     if ([$0] == [NOSTARTUP])
  717.     {
  718.         if (match($1 ON OFF))
  719.         {
  720.             if ([$1] == [ON]) {@ PP.SET.NOSTARTUP = 1} {@ PP.SET.NOSTARTUP = 0}
  721.         }
  722.         echo *** Suppression of script startup screens is now $pp.set.onoff($PP.SET.NOSTARTUP)
  723.         @ VU = 1
  724.     }
  725.     if (match(FUN* $0))
  726.     {
  727.         if (match($1 ON OFF))
  728.         {
  729.             if ([$1] == [ON]) {@ PP.SET.FUNKYBANS = 1} {@ PP.SET.FUNKYBANS = 0}
  730.         }
  731.         echo *** Insert random ?'s into bans is now $pp.set.onoff($PP.SET.FUNKYBANS)
  732.         @ VU = 1
  733.     }
  734.     if (match(SHOWSPLIT* $0))
  735.     {
  736.         if (match($1 ON OFF))
  737.         {
  738.             if ([$1] == [ON]) {@ PP.SET.SHOWSPLITTERS = 1} {@ PP.SET.SHOWSPLITTERS = 0}
  739.         }
  740.         echo *** Showing of users who join/signoff in netsplits is now $pp.set.onoff($PP.SET.SHOWSPLITTERS)
  741.         @ VU = 1
  742.     }
  743.     if ([$0] == [MFORMAT])
  744.     {
  745.         @ VU = 1
  746.         if ([$1])
  747.         {
  748.             if (match($1 IRCII TEXTBOX PHOENIX LICE DEFAULT))
  749.             {
  750.                 @ PP.SET.MRFORMAT = PP.MR[$1]
  751.                 @ PP.SET.NRFORMAT = PP.NR[$1]
  752.                 @ PP.SET.MSFORMAT = PP.MS[$1]
  753.                 @ PP.SET.NSFORMAT = PP.NS[$1]
  754.                 echo *** Your msgs/notices now look like: $toupper($1)
  755.             } {/echo *** /pp mformat [<ircii/textbox/phoenix/lice>]}
  756.         } {^pp.set.setmformat}
  757.     }
  758.     if (match(CHAN* $0))
  759.     {
  760.         if (match($1 ON OFF))
  761.         {
  762.             if ([$1] == [ON]) {@ PP.SET.CHANPROT = 1} {@ PP.SET.CHANPROT = 0}
  763.         }
  764.         echo *** Channel protection is now $pp.set.onoff($PP.SET.CHANPROT)
  765.         @ VU = 1
  766.     }
  767.     if (match(DES* $0))
  768.     {
  769.         ^pp.set.changetoggle V $1
  770.         echo *** Desynched user notification is now $pp.set.tstatus(V)
  771.         @ VU = 1
  772.     }
  773.     if (match(AIG* $0))
  774.     {
  775.         ^pp.set.changetoggle I $1
  776.         echo *** Auto-ignoring on msg/notice/ctcp/nick floods is now $pp.set.tstatus(I)
  777.         @ VU = 1
  778.     }
  779.     if ([$0] == [MOTD])
  780.     {
  781.         if (match($1 ON OFF))
  782.         {
  783.             if ([$1] == [ON]) {^set suppress_server_motd OFF} {^set suppress_server_motd ON}
  784.         }
  785.         if (suppress_server_motd == [ON]) {/echo *** Server motd display at startup is now OFF}
  786.         {/echo *** Server motd display at startup is now ON}
  787.         @ VU = 1
  788.     }
  789.     if (match(FFILT* $0))
  790.     {
  791.         ^pp.set.changetoggle F $1
  792.         echo *** Filtering of known floods in msgs/notices/public messages is now $pp.set.tstatus(F)
  793.         @ VU = 1
  794.     }
  795.     if (match(ARTK* $0))
  796.     {
  797.         ^pp.set.changetoggle A $1
  798.         echo *** ASCII art kicker is now $pp.set.tstatus(A)
  799.         @ VU = 1
  800.     }
  801.     if (match(HELPU* $0))
  802.     {
  803.         ^pp.set.changetoggle P $1
  804.         echo *** Automatic unloading of help information is now $pp.set.tstatus(P)
  805.         @ VU = 1
  806.     }
  807.     if (match(NFP* $0))
  808.     {
  809.         ^pp.set.changetoggle N $1
  810.         echo *** Kicking on nick flood is now $pp.set.tstatus(N)
  811.         @ VU = 1
  812.     }
  813.     if (match(ENEM* $0))
  814.     {
  815.         ^pp.set.changetoggle E $1
  816.         echo *** Checking/use of enemies list is now $pp.set.tstatus(E)
  817.         @ VU = 1
  818.     }
  819.     if (match(FRI* $0))
  820.     {
  821.         ^pp.set.changetoggle L $1
  822.         echo *** Checking/use of friends list is now $pp.set.tstatus(L)
  823.         @ VU = 1
  824.     }
  825.     if (match(AWAYN* $0))
  826.     {
  827.         ^pp.set.changetoggle O $1
  828.         echo *** Public announcement of away status is now $pp.set.tstatus(O)
  829.         @ VU = 1
  830.     }
  831.     if (match(AWAYL* $0))
  832.     {
  833.         ^pp.set.changetoggle G $1
  834.         echo *** Logging of messages and important events while away is now $pp.set.tstatus(G)
  835.         @ VU = 1
  836.     }
  837.     if (match(NOTI* $0))
  838.     {
  839.         ^pp.set.changetoggle W $1
  840.         echo *** Sending of general warnings/notices is now $pp.set.tstatus(W)
  841.         @ VU = 1
  842.     }
  843.     if (match(KREJ* $0))
  844.     {
  845.         ^pp.set.changetoggle J $1
  846.         echo *** Automatic rejoining on kick is now $pp.set.tstatus(J)
  847.         @ VU = 1
  848.     }
  849.     if (match(MASSP* $0))
  850.     {
  851.         ^pp.set.changetoggle M $1
  852.         echo *** Mass deop/kick protection is now $pp.set.tstatus(M)
  853.         @ VU = 1
  854.     }
  855.     if (match(MASSA* $0))
  856.     {
  857.         if (match($1 KICK DEOP))
  858.         {
  859.             if ([$1] == [KICK]) {@ PP.SET.MASSRESP = 1} {@ PP.SET.MASSRESP = 0}
  860.         }
  861.         if (PP.SET.MASSRESP) {/echo *** Action taken on mass deop/kick is now KICK}
  862.         {/echo *** Action taken on mass deop/kick is now DEOP}
  863.         @ VU = 1
  864.     }
  865.     if (match(KEYP* $0))
  866.     {
  867.         ^pp.set.changetoggle K $1
  868.         echo *** Channel key flash protection is now $pp.set.tstatus(K)
  869.         @ VU = 1
  870.     }
  871.     if (([$0] == [SERVOP])||([$0] == [NHP]))
  872.     {
  873.         ^pp.set.changetoggle S $1
  874.         echo *** Automatic removal of server ops is now $pp.set.tstatus(S)
  875.         @ VU = 1
  876.     }
  877.     if (match(CLONEP* $0))
  878.     {
  879.         ^pp.set.changetoggle C $1
  880.         echo *** Clonebot mass-join protection is now $pp.set.tstatus(C)
  881.         @ VU = 1
  882.     }
  883.     if (match(BAND* $0))
  884.     {
  885.         ^pp.set.changetoggle B $1
  886.         echo *** Ban defense is now $pp.set.tstatus(B)
  887.         @ VU = 1
  888.     }
  889.     if ([$0] == [PING])
  890.     {
  891.         ^pp.set.changetoggle X $1
  892.         echo *** Ignoring of CTCP PINGs is now $pp.set.tstatus(X)
  893.         @ VU = 1
  894.         ^pp.set.setupctcp
  895.     }
  896.     if (match(FING* $0))
  897.     {
  898.         ^pp.set.changetoggle Z $1
  899.         echo *** Ignoring of CTCP FINGERs is now $pp.set.tstatus(Z)
  900.         @ VU = 1
  901.         ^pp.set.setupctcp
  902.     }
  903.     if (match(VER* $0))
  904.     {
  905.         ^pp.set.changetoggle Y $1
  906.         echo *** Ignoring of CTCP VERSIONs is now $pp.set.tstatus(Y)
  907.         @ VU = 1
  908.         ^pp.set.setupctcp
  909.     }
  910.     if ([$0] == [PMATCH])
  911.     {
  912.         if ([$1])
  913.         {
  914.             if ((PP.SET.PMATCH == [.])&&([$1] != [.])) {^pp.snm $strip(_-[] $N) $1}
  915.             if ((PP.SET.PMATCH != [.])&&([$1] == [.])) {^pp.snm $PP.SET.PMATCH $strip(_-[] $N)}
  916.             @ PP.SET.PMATCH = [$1]
  917.         }
  918.         echo *** String to match and highlight in public now set to ${PP.SET.PMATCH}
  919.         @ VU = 1
  920.     }
  921.     if (match(IGT* $0))
  922.     {
  923.         if ([$1]) {
  924.             if (!isalpha($1)) {@ PP.SET.IGSECS = [$1]}
  925.             {/echo *** Must be a number (recommended value: 10-60)}
  926.         }
  927.         echo *** Number of seconds to auto-ignore flooders is now: ${PP.SET.IGSECS}
  928.         @ VU = 1
  929.     }
  930.     if (match(NFS* $0))
  931.     {
  932.         if ([$1]) {
  933.             if (!isalpha($1)) {@ PP.SET.NFSENS = [$1]}
  934.             {/echo *** Must be a number (recommended value: 3)}
  935.         }
  936.         echo *** Nick flood protection sensitivity is now: ${PP.SET.NFSENS}
  937.         if (PP.SET.NFSENS > 3) {/echo *** Warning: a setting of ${PP.SET.NFSENS} is very sensitive! (higher values more sensitive)}
  938.         @ VU = 1
  939.     }
  940.     if ([$0] == [ROWS])
  941.     {
  942.         if ([$1]) {
  943.             if (!isalpha($1)) {@ PP.SET.NUMLINES = [$1] - 2}
  944.             {/echo *** Must be a number}
  945.         }
  946.         echo *** Number of rows on this display is now: ${PP.SET.NUMLINES + 2}
  947.         @ VU = 1
  948.     }
  949.     if (match(CLONES* $0))
  950.     {
  951.         if ([$1]) {
  952.             if (!isalpha($1)) {@ PP.SET.CPSENS = [$1]}
  953.             {/echo *** Must be a number (recommended value: 3-5)}
  954.         }
  955.         echo *** Clonebot mass-join protection sensitivity is now: ${PP.SET.CPSENS}
  956.         if (PP.SET.CPSENS < 3) {/echo *** Warning: a setting of ${PP.SET.CPSENS} is very sensitive! (lower values more sensitive)}
  957.         @ VU = 1
  958.     }
  959.     if ([$0] == [JFLEN])
  960.     {
  961.         if ([$1]) {
  962.             if (!isalpha($1)) {@ PP.SET.JFLEN = [$1]}
  963.             {/echo *** Must be a number (recommended value: 200)}
  964.         }
  965.         echo *** First word length for a message to be a junkflood is now: ${PP.SET.JFLEN}
  966.         @ VU = 1
  967.     }
  968.     if (match(AUTOA* $0))
  969.     {
  970.         if ([$1]) {
  971.             if (!isalpha($1)) {@ PP.SET.AUTOAWAY = [$1]}
  972.             {
  973.                 if ([$1] == [OFF]) {@ PP.SET.AUTOAWAY = 0} {/echo *** Must be a number or 'off' to turn off.}
  974.             }
  975.         }
  976.         echo *** Minutes of idle-time before being set away (0=auto-away disabled): ${PP.SET.AUTOAWAY}
  977.         @ VU = 1
  978.     }
  979.     if (match(*CMD $0))
  980.     {
  981.         foreach PP.SET AA {
  982.             if ([$AA] == [$0])
  983.             {
  984.                 if ([$1]) {@ PP.SET[$AA] = [$1-]}
  985.                 echo *** $AA is now [${PP.SET[$AA]}]
  986.                 @ VU = 1
  987.             }
  988.         }
  989.     }
  990.     if (match(MSGB* $0))
  991.     {
  992.         if (match($1 ON OFF))
  993.         {
  994.             ^pp.set.changetoggle Q $1
  995.             if ([$1] == [ON]) {^set beep_on_msg MSG}
  996.             {^set beep_on_msg NONE}
  997.         }
  998.         echo *** Beeping on private messages is now $pp.set.tstatus(Q)
  999.         @ VU = 1
  1000.     }
  1001.     if (match(LOGF* $0))
  1002.     {
  1003.         if ([$1]) {^set logfile $1}
  1004.         echo *** IRC logging is now sent to file ${LOGFILE}
  1005.         @ VU = 1
  1006.     }
  1007.     if ([$0] == [LOG])
  1008.     {
  1009.         if (match($1 ON OFF)) {^if ([$1] == [ON]) {^set log on} {^set log off}}
  1010.         echo *** Logging to $LOGFILE is now ${LOG}
  1011.         @ VU = 1
  1012.     }
  1013.     if (match(AWAYW* $0))
  1014.     {
  1015.         ^pp.set.changetoggle H $1
  1016.         echo *** Away log writing to $PP.SET.ALFILE is now $pp.set.tstatus(H)
  1017.         @ VU = 1
  1018.     }
  1019.     if ([$0] == [AFILE])
  1020.     {
  1021.         if ([$1]) {@ PP.SET.ALFILE = [$1]}
  1022.         echo *** Away log file is now ${PP.SET.ALFILE}
  1023.         @ VU = 1
  1024.     }
  1025. }
  1026.  
  1027. alias pp {
  1028.     if ([$0])
  1029.     {
  1030.         @ VU = 0
  1031.         foreach PP.SETCHECKS AA {^if (!VU) {$PP.SETCHECKS[$AA] $*}}
  1032.         if (!VU) {/echo *** No such variable: $0}
  1033.         ^assign -VU
  1034.     } {/echo *** /pp <variable> [<new setting>] (If new setting is left out, current setting is shown)}
  1035. }
  1036.  
  1037. # ----------------------------------------------------------------------------
  1038. # Command abbreviations
  1039. # ----------------------------------------------------------------------------
  1040.  
  1041. alias w {/who $*}
  1042. alias m {/msg $*}
  1043. alias t {/topic $*}
  1044. alias c {/mode $*}
  1045. alias l {
  1046.     leave $0
  1047.     if ([$1]) {/l $1-}
  1048. }
  1049. alias j {
  1050.     if (ischannel($1)) {/join $0} {/join $0 $1}
  1051.     if (ischannel($1)) {/j $1-}
  1052.     if (ischannel($2)) {/j $2-}
  1053. }
  1054. alias , {/whois $*}
  1055. alias wi {/whois $*}
  1056. alias ww {/whowas $*}
  1057. alias n {/nick $*}
  1058. alias k {/kick $*}
  1059. alias o {/op $*}
  1060. alias d {/deop $*}
  1061.  
  1062. alias scan {/names $*}
  1063.  
  1064. # ----------------------------------------------------------------------------
  1065. # Basic channel op command aliases
  1066. # ----------------------------------------------------------------------------
  1067.  
  1068. # Here's all the recursive list processing aliases for the mass commands
  1069. # pp.listm.<# at once> <mode> <#channel> <users>
  1070. alias pp.listm.1 {
  1071.     //mode $1 $0 $2
  1072.     if ([$3]) {^pp.listm.1 $0 $1 $3-}
  1073. }
  1074. alias pp.listm.2 {
  1075.     //mode $1 $0 $2 $3
  1076.     if ([$4]) {^pp.listm.2 $0 $1 $4-}
  1077. }
  1078. alias pp.listm.3 {
  1079.     //mode $1 $0 $2 $3 $4
  1080.     if ([$5]) {^pp.listm.3 $0 $1 $5-}
  1081. }
  1082. alias pp.listm.4 {
  1083.     //mode $1 $0 $2 $3 $4 $5
  1084.     if ([$6]) {^pp.listm.4 $0 $1 $6-}
  1085. }
  1086. # pp.listk <#channel> <nicks> ($KREASON contains reason for kicks)
  1087. alias pp.listk {
  1088.     //kick $0 $1 $KREASON
  1089.     if ([$2]) {^pp.listk $0 $2-}
  1090. }
  1091. # pp.listdcc <file> <nicks>
  1092. alias pp.listdcc {
  1093.     //^dcc send $1 $0
  1094.     if ([$2]) {^pp.listdcc $0 $2-}
  1095. }
  1096. # pp.listmsg <PRIVMSG/NOTICE> <nicks/channels> (SEND_MSG contains message)
  1097. alias pp.listmsg {
  1098.     ^quote $0 $1 :$SEND_MSG
  1099.     if ([$2]) {^pp.listmsg $0 $2-}
  1100. }
  1101. # pp.listunban <#channel> <strings>
  1102. alias pp.listunban {
  1103.     if ([$4])
  1104.     {
  1105.         //mode $0 -bbb $1 $2 $3
  1106.         ^pp.listunban $0 $4-
  1107.     } {^if ([$3]) {//mode $0 -bbb $1 $2 $3} {^if ([$2]) {//mode $0 -bb $1 $2} {^if ([$1]) {//mode $0 -b $1}}}}
  1108. }
  1109.  
  1110. # pp.mdop <#channel> <# at once> <mask>
  1111. # Smart massdeopper: deops the closest people net-wise first.  (Gee, I wonder
  1112. # how many scripts this is gonna appear in?)
  1113. alias pp.mdop {
  1114.     @ HIGHHOPS = 0
  1115.     @ DMASK = [$2]
  1116.     on ^who * {
  1117.         if ((match(*${DMASK}* $1!$3@$4))&&([$1] != N))
  1118.         {
  1119.             if (!match($1 $PP.BOTNICKS))
  1120.             {
  1121.                 if (!PP.EPIC)
  1122.                 {
  1123.                     @ MDOPZ[$5] = MDOPZ[$5]##[ $1]
  1124.                     if ([$5] > HIGHHOPS) {@ HIGHHOPS = [$5]}
  1125.                 }
  1126.                 {
  1127.                     @ MDOPZ[$6] = MDOPZ[$6]##[ $1]
  1128.                     if ([$6] > HIGHHOPS) {@ HIGHHOPS = [$6]}
  1129.                 }
  1130.             }
  1131.         }
  1132.     }
  1133.     //^who -chops $0
  1134.     @ DEOPCNT = [$1]
  1135.     @ DEOPCHAN = [$0]
  1136.     wait -CMD if (1) {
  1137.         if (DEOPCNT <= 1) {@ MCH = [-o]}
  1138.         if (DEOPCNT == 2) {@ MCH = [-oo]}
  1139.         if (DEOPCNT == 3) {@ MCH = [-ooo]}
  1140.         if (DEOPCNT >= 4) {@ MCH = [-oooo]}
  1141.         @ CTR = 0
  1142.         while (CTR <= HIGHHOPS)
  1143.         {
  1144.             @ MDOPZ = MDOPZ##[ $MDOPZ[$CTR]]
  1145.             ^assign -MDOPZ[$CTR]
  1146.             @ CTR = CTR + 1
  1147.         }
  1148.         ^pp.listm.$DEOPCNT $MCH $DEOPCHAN $MDOPZ
  1149.         ^assign -DEOPCNT
  1150.         ^assign -DEOPCHAN
  1151.         ^assign -MCH
  1152.         ^assign -HIGHHOPS
  1153.         ^assign -CTR
  1154.         ^assign -MDOPZ
  1155.         ^assign -DMASK
  1156.         ^on who -
  1157.     }
  1158. }
  1159.  
  1160. # pp.mkick <#channel> <mask> <reason>
  1161. alias pp.mkick {
  1162.     @ KMASK = [$1]
  1163.     ^on ^who * {
  1164.         ^if ((match(*${KMASK}* $1!$3@$4))&&([$1] != N))
  1165.         {
  1166.             ^if (!match($1 $PP.BOTNICKS)) {@ MKZ = [$1 $MKZ]}
  1167.         }
  1168.     }
  1169.     //^who $0
  1170.     @ KCHAN = [$0]
  1171.     @ KREASON = [$2-]
  1172.     wait -CMD if (1) {
  1173.         ^pp.listk $KCHAN $MKZ
  1174.         ^assign -KCHAN
  1175.         ^assign -MKZ
  1176.         ^assign -KMASK
  1177.         ^assign -KREASON
  1178.         ^on who -
  1179.     }
  1180. }
  1181.  
  1182. # pp.mop <#channel> <mask>
  1183. alias pp.mop {
  1184.     @ OPMASK = [$1]
  1185.     ^on ^who * {^if ((!match(*@* $2))&&(match(*${OPMASK}* $1!$3@$4))) {^if ([$1] != N) {@ MOPZ = [$MOPZ $1]}}}
  1186.     //^who $0
  1187.     @ MOPCHAN = [$0]
  1188.     wait -CMD if (1) {
  1189.         ^pp.listm.3 +ooo $MOPCHAN $MOPZ
  1190.         ^assign -MOPCHAN
  1191.         ^assign -MOPZ
  1192.         ^assign -OPMASK
  1193.         ^on ^who -
  1194.     }
  1195. }
  1196.  
  1197. # pp.modev <#channel> <mask> <+/->
  1198. alias pp.modev {
  1199.     @ VMASK = [$1]
  1200.     ^on ^who * {^if (match(*${VMASK}* $1!$3@$4)) {@ MVZ = [$MVZ $1]}}
  1201.     //^who $0
  1202.     @ MVCHAN = [$0]
  1203.     @ MVMODE = [$2]
  1204.     wait -CMD if (1) {
  1205.         ^pp.listm.3 ${MVMODE}vvv $MVCHAN $MVZ
  1206.         ^assign -MVCHAN
  1207.         ^assign -MVMODE
  1208.         ^assign -MVZ
  1209.         ^assign -VMASK
  1210.         ^on ^who -
  1211.     }
  1212. }
  1213.  
  1214. # The user mass commands
  1215. # mdop/mvop/mop/munvop [<mask>]
  1216. alias mdop.1 {^if (gotops($C)) {^if ([$0]) {^pp.mdop $C 1 $0} {^pp.mdop $C 1 *}} {/echo *** You don't have ops on $C}}
  1217. alias mdop.2 {^if (gotops($C)) {^if ([$0]) {^pp.mdop $C 2 $0} {^pp.mdop $C 2 *}} {/echo *** You don't have ops on $C}}
  1218. alias mdop.3 {^if (gotops($C)) {^if ([$0]) {^pp.mdop $C 3 $0} {^pp.mdop $C 3 *}} {/echo *** You don't have ops on $C}}
  1219. alias mdop.4 {^if (gotops($C)) {^if ([$0]) {^pp.mdop $C 4 $0} {^pp.mdop $C 4 *}} {/echo *** You don't have ops on $C}}
  1220. alias mdop {^mdop.4 $*}
  1221. alias mop {^if (gotops($C)) {^if ([$0]) {^pp.mop $C $0} {^pp.mop $C *}} {/echo *** You don't have ops on $C}}
  1222. alias mvop {^if (gotops($C)) {^if ([$0]) {^pp.modev $C $0 +} {^pp.modev $C * +}} {/echo *** You don't have ops on $C}}
  1223. alias munvop {^if (gotops($C)) {^if ([$0]) {^pp.modev $C $0 -} {^pp.modev $C * -}} {/echo *** You don't have ops on $C}}
  1224.  
  1225. # Fast mdop (x4)
  1226. alias fmdop {
  1227.     if (gotops($C))
  1228.     {
  1229.         if (match(*!*@* $0)) {@ UM = [$0]} {@ UM = [*!*@*]}
  1230.         foreach PP.USERS.$encode($tolower($C)) AA {
  1231.             if (decode($AA) != N)
  1232.             {
  1233.                 if ((ischanop($decode($AA) $C))&&(match($UM $decode($AA)!$word(2 $PP.USERS[$encode($tolower($C))][$AA])))) {@ MDOPZ = MDOPZ##[$decode($AA) ]}
  1234.             }
  1235.         }
  1236.         pp.listm.4 -oooo $C $MDOPZ
  1237.         ^assign -MDOPZ
  1238.         ^assign -UM
  1239.     } {/echo *** You don't have ops on $C}
  1240. }
  1241.  
  1242. # op and deop aliases
  1243. # op/deop <nicks>
  1244. alias op {^if ([$0]) {^pp.listm.3 +ooo $C $*} {/echo *** /op <nick> [<nick> ...]}}
  1245. alias deop {^if ([$0]) {^pp.listm.2 -oo $C $*} {/echo *** /deop <nick> [<nick> ...]}}
  1246.  
  1247. # masskick aliases
  1248. # masskick [<reason>] (kicks with mask *)  mkick [<mask>]
  1249. alias masskick {^if (gotops($C)) {^if ([$0]) {^pp.mkick $C * $*} {^pp.mkick $C * [Masskick: *]}} {/echo *** You don't have ops on $C}}
  1250. alias mkick {^if (gotops($C)) {^if ([$0]) {^pp.mkick $C $0 [Masskick: $0]} {^pp.mkick $C * [Masskick: *]}} {/echo *** You don't have ops on $C}}
  1251.  
  1252. # Kicks all non-operators on channel
  1253. alias lkick {
  1254.     if (gotops($C))
  1255.     {
  1256.         ^on ^who * {/if (([$1] != N)&&(!rmatch($2 *@*))) {//kick $0 $1 [Non-Operator Kick]}}
  1257.         //^who *
  1258.         wait -CMD ^on who -
  1259.     } {/echo *** You don't have ops on $C}
  1260. }
  1261.  
  1262. # massdcc <file> [<mask>]
  1263. alias massdcc {
  1264.     if ([$0])
  1265.     {
  1266.         if ([$1]) {@ DCCMASK = [$1]} {@ DCCMASK = [*]}
  1267.         ^on ^who * {^if (([$1] != N)&&(match(*${DCCMASK}* $1!$3@$4))) {@ DCCPPL = [$1 $DCCPPL]}}
  1268.         //^who *
  1269.         @ MDFILE = [$0]
  1270.         wait -CMD if (1) {
  1271.             ^on who -
  1272.             ^pp.listdcc $MDFILE $DCCPPL
  1273.             ^assign -DCCMASK
  1274.             ^assign -DCCPPL
  1275.             echo *** Sent DCC SEND request for $MDFILE to everyone in $C
  1276.             ^assign -MDFILE
  1277.         }
  1278.     } {/echo *** /massdcc <file> [<mask>]}
  1279. }
  1280.  
  1281. # Re-aliased to not require channel names
  1282. alias invite {^if (ischannel($1)) {//invite $*} {//invite $0 $C}}
  1283. alias kick {^if (ischannel($0)) {//kick $*} {//kick $C $0 $1-}}
  1284. alias mode {^if (ischannel($0)) {//mode $*} {^if ([$0] == N) {//mode $*} {//mode $C $*}}}
  1285.  
  1286. # pp.snm old new
  1287. alias pp.snm {
  1288.     EVAL ^on raw_irc - "% PRIVMSG #% :*$0*"
  1289.     EVAL ^on ^raw_irc "% PRIVMSG #% :*$1*" {
  1290.         if (match(*ACTION* $3))
  1291.         {
  1292.             if ([$2] == C) {/xecho -window $winnum() -level PUBLIC * $nickonly($0) $strip( $4-)}
  1293.             {/xecho -window $winnum() -level PUBLIC * $nickonly($0):$2 $strip( $4-)}
  1294.         }
  1295.         {
  1296.             if ([$2] == C) {/xecho -window $winnum() -level PUBLIC <$nickonly($0)> $strip( $mid(1 65535 $3) $4-)}
  1297.             {/xecho -window $winnum() -level PUBLIC <$nickonly($0):$2> $strip( $mid(1 65535 $3) $4-)}
  1298.         }
  1299.     }
  1300. }
  1301.  
  1302. alias nick {
  1303.     ^if ([$0])
  1304.     {
  1305.         if (PP.SET.PMATCH == [.]) {^pp.snm $strip(_-[] $N) $strip(_-[] $0)}
  1306.         if (PP.DCC) {^dcc.onnick $*}
  1307.         quote NICK $*
  1308.     } {/nick $randcrap(9)}
  1309. }
  1310.  
  1311. # We don't use the -k$M method because of how the mode locking code works
  1312. alias clearmode {
  1313.     if (ischannel($0))
  1314.     {
  1315.         ^on ^324 * {@ CMODE = strip(:+ $2)##[ $3-]}
  1316.         //mode $0
  1317.         @ CMCHAN = [$0]
  1318.         wait -CMD if (1) {
  1319.             ^on 324 -
  1320.             //mode $CMCHAN -k$CMODE
  1321.             ^assign -CMCHAN
  1322.             ^assign -CMODE
  1323.         }
  1324.     } {/clearmode $C}
  1325. }
  1326.  
  1327. # Bans bots and bomb/inverse/beep/etc usernames
  1328. alias botban {//mode $C +bbb *b?t!*@* *srv!*@* *s?rv!*@*}
  1329. alias bot {//bot}
  1330.  
  1331. # pp.clearban <channel> <mask>
  1332. alias pp.clearban {
  1333.     @ BANMASK = [$1]
  1334.     ^on ^raw_irc "% 367 *" {^if ((match(*${BANMASK}* $4))||(match($4 $BANMASK))) {@ CBUNBAND = [$4 $CBUNBAND]}}
  1335.     //mode $0 b
  1336.     wait -CMD if (1) {
  1337.         ^pp.listunban $C $CBUNBAND
  1338.         ^assign -CBUNBAND
  1339.         ^assign -BANMASK
  1340.         ^on raw_irc - "% 367 *"
  1341.     }
  1342. }
  1343.  
  1344. # User clearban alias
  1345. # clearban [<mask>]
  1346. alias clearban {^if ([$0]) {^pp.clearban $C $*} {^pp.clearban $C *}}
  1347.  
  1348. # Unban alias: looks up user's user@host and runs a clearban
  1349. # unban <nick>
  1350. alias unban {
  1351.     if ([$0]) {
  1352.         if (match(*!*@* $0)) {^pp.listunban $C $*}
  1353.         {
  1354.             ^Userhost $0 -CMD if ([$3]) {
  1355.                 if ([$4] != [<UNKNOWN>]) {^pp.clearban $C $0!$3@$4} {/echo *** $0 is not on IRC}
  1356.             }
  1357.         }
  1358.     } {/echo *** /unban <nick/umask>}
  1359. }
  1360.         
  1361. # ban <nick>
  1362. alias ban {
  1363.     if ([$0])
  1364.     {
  1365.         if (match(*!*@* $0)) {//mode $C +bbb $*}
  1366.         {
  1367.             ^Userhost $0 -CMD if ([$3]) {
  1368.                 if ([$4] != [<UNKNOWN>])
  1369.                 {
  1370.                     @ HNAME = [$4]
  1371.                     if ((!isalpha($HNAME))&&(match(*.*.*.* $HNAME))) {@ ST = [*!*$mid(1 1000 $3)@]##left($rindex(. $HNAME) $HNAME)##[.*]}
  1372.                     {@ ST = [*!*$mid(1 1000 $3)@*$right(${@HNAME-index(. $4)} $4)]}
  1373.                     if (PP.SET.FUNKYBANS)
  1374.                     {
  1375.                         @ AA = []
  1376.                         @ CT = 0
  1377.                         while (CT < [$@ST])
  1378.                         {
  1379.                             @ SC = mid($CT 1 $ST)
  1380.                             if ((!match(*${SC}* @!.))&&(SC != [*]))
  1381.                             {
  1382.                                 if (rand(4) == 2) {@ AA = AA##[?]}
  1383.                                 {@ AA = AA##SC}
  1384.                             } {@ AA = AA##SC}
  1385.                             @ CT = CT + 1
  1386.                         }
  1387.                         ^assign -CT
  1388.                         ^assign -SC
  1389.                     } {@ AA = ST}
  1390.                     ^assign -ST
  1391.                     ^assign -HNAME
  1392.                     //mode $C +b $AA
  1393.                 } {/echo *** $0 is not on IRC}
  1394.             }
  1395.         }
  1396.     } {//mode $C b}
  1397. }
  1398.  
  1399. # /wordkick <channel> <word/phrase>
  1400. # or /wordkick <channel> off
  1401. alias wordkick {
  1402.     if ([$1])
  1403.     {
  1404.         if (ischannel($0)) {@ WCHAN = [$0]} {@ WCHAN = [#$0]}
  1405.         if ([$1] == [OFF])
  1406.         {
  1407.             foreach WORDKICKS AA {
  1408.                 if (decode($AA) == [$WCHAN])
  1409.                 {
  1410.                     EVAL ^on raw_irc - "% ??????% $decode($AA) :*$WORDKICKS[$AA]*"
  1411.                     ^assign -WORDKICKS[$AA]
  1412.                     @ WK = 1
  1413.                 }
  1414.             }
  1415.             if (WK) {/echo *** Wordkick for $WCHAN removed} {/echo *** There is no wordkick active on $WCHAN}
  1416.             ^assign -WK
  1417.         }
  1418.         {
  1419.             @ WORDKICKS[$encode($WCHAN)] = [$1-]
  1420.             EVAL ^on -raw_irc "% ??????% $WCHAN :*$1-*" {
  1421.                 //kick $2 $nickonly($0) [Wordkick]
  1422.             }
  1423.             echo *** Wordkick for '$1-' now active on channel $WCHAN
  1424.         }
  1425.         ^assign -WCHAN
  1426.     }
  1427.     {
  1428.         echo *** Active wordkicks:
  1429.         foreach WORDKICKS AA {/echo *** Channel: $[12]decode($AA) Word/phrase: $WORDKICKS[$AA]}
  1430.     }
  1431. }
  1432.  
  1433. # ----------------------------------------------------------------------------
  1434. # Friends and enemies lists handlers
  1435. # ----------------------------------------------------------------------------
  1436.  
  1437. # 'CK' is $encode(*)
  1438.  
  1439. # pp.addl <FRIENDS/ENEMIES> <umask> <channel/*>
  1440. alias pp.addl {
  1441.     if ((!match($1 $PP[$0][$encode($toupper($2))]))&&(!match($1 $PP[$0][CK])))
  1442.     {
  1443.         if (PP[$0][$encode($toupper($2))]) {@ PP[$0][$encode($toupper($2))] = PP[$0][$encode($toupper($2))]##[ $1]} {@ PP[$0][$encode($toupper($2))] = [$1]}
  1444.         if ([$2] == [*]) {/echo *** User mask [$1] added to global $tolower($0) list}
  1445.         {/echo *** User mask [$1] added to $tolower($0) list for channel mask $2}
  1446.     }
  1447.     {
  1448.         if ([$2] == [*]) {/echo *** A user mask matching [$1] is already on your global friends list}
  1449.         {/echo *** A user mask matching [$1] is already on the list for channel mask $2 or the global list}
  1450.     }
  1451. }
  1452. # pp.rml <FRIENDS/ENEMIES> <umask> <channel/*>
  1453. alias pp.rml {
  1454.     if ((match($1 $PP[$0][$encode($toupper($2))]))||(rmatch($1 $PP[$0][$encode($toupper($2))])))
  1455.     {
  1456.         @ CN = encode($toupper($2))
  1457.         @ AA = 0
  1458.         while (word($AA $PP[$0][$CN]))
  1459.         {
  1460.             if ((match($1 $word($AA $PP[$0][$CN])))||(match($word($AA $PP[$0][$CN]) $1)))
  1461.             {
  1462.                 ^delword $word($AA $PP[$0][$CN]) $PP[$0][$CN]
  1463.                 @ PP[$0][$CN] = NLIST
  1464.                 ^assign -NLIST
  1465.                 @ AA = 0
  1466.             } {@ AA = AA + 1}
  1467.         }
  1468.         if (!(word(0 $PP[$0][$CN]))) {^assign -PP[$0][$CN]}
  1469.         ^assign -CN
  1470.         if ([$2] == [*]) {/echo *** All patterns matching [$1] removed from global $tolower($0) list}
  1471.         {/echo *** All patterns matching [$1] removed from list for channel mask $2}
  1472.     }
  1473.     {
  1474.         if ([$2] == [*]) {/echo *** No patterns matching [$1] are on your global friends list}
  1475.         {/echo *** No patterns matching [$1] are on the list for channel mask $2 or the global list}
  1476.     }
  1477. }
  1478. # pp.rmlall <FRIENDS/ENEMIES> <umask>
  1479. alias pp.rmlall {
  1480.     EVAL ^foreach PP.$0 AB {
  1481.         if ((match($1 $PP[$0][$AB]))||(rmatch($1 $PP[$0][$AB]))) {^pp.rml $0 $1 $tolower($decode($AB))}
  1482.     }
  1483. }
  1484.  
  1485. # /friend <nick/umask> [<channel mask>]
  1486. alias friend {
  1487.     if ([$0])
  1488.     {
  1489.         if (match(*!*@* $0)) {^if ([$1]) {/pp.addl FRIENDS $0 $1} {/pp.addl FRIENDS $0 *}}
  1490.         {
  1491.             if ([$1]) {@ AA = [$1]} {@ AA = [*]}
  1492.             ^Userhost $0 -CMD if ([$3]) {
  1493.                 if ([$4] != [<UNKNOWN>])
  1494.                 {
  1495.                     @ UHOST = [$mid(1 $index(@ $3@$4) $mid(${index(! $3@$4)+1} 1000 $3@$4))*$mid(${index(. $3@$4)+1} 1000 $3@$4)]
  1496.                     ^pp.addl FRIENDS *!*$UHOST $AA
  1497.                     ^alias echo {}
  1498.                     ^pp.rml ENEMIES *!*$UHOST $AA
  1499.                     ^alias -echo
  1500.                     ^assign -UHOST
  1501.                     if (index(W $PP.SET) >= 0) {//^notice $0 [PurePak] You have been added to my friends list for channels matching [${AA}]: type /ctcp $N HELP for functions available to you}
  1502.                 } {/echo *** $0 is not on IRC}
  1503.             }
  1504.         }
  1505.     } {/echo *** /friend <nick/umask> [<channel mask>] (can contain wildcards)}
  1506. }
  1507. # /enemy <nick/umask> [<channel mask>]
  1508. alias enemy {
  1509.     if ([$0])
  1510.     {
  1511.         if (match(*!*@* $0)) {^if ([$1]) {/pp.addl ENEMIES $0 $1} {/pp.addl ENEMIES $0 *}}
  1512.         {
  1513.             if ([$1]) {@ AA = [$1]} {@ AA = [*]}
  1514.             ^Userhost $0 -CMD if ([$3]) {
  1515.                 if ([$4] != [<UNKNOWN>])
  1516.                 {
  1517.                     @ UHOST = [$mid(1 $index(@ $3@$4) $mid(${index(! $3@$4)+1} 1000 $3@$4))*$mid(${index(. $3@$4)+1} 1000 $3@$4)]
  1518.                     ^pp.addl ENEMIES *!*$UHOST $AA
  1519.                     ^alias echo {}
  1520.                     ^pp.rml FRIENDS *!*$UHOST $AA
  1521.                     ^alias -echo
  1522.                     ^assign -UHOST
  1523.                 } {/echo *** $0 is not on IRC}
  1524.             }
  1525.         }
  1526.     } {/echo *** /enemy <nick/umask> [<channel mask>] (can contain wildcards)}
  1527. }
  1528.  
  1529. # /rmfriend <nick/umask> [<channel mask>]
  1530. alias rmfriend {
  1531.     if ([$0])
  1532.     {
  1533.         if (match(*!*@* $0)) {^if ([$1]) {/pp.rml FRIENDS $0 $1} {/pp.rmlall FRIENDS $0}}
  1534.         {
  1535.             if ([$1]) {@ AA = [$1]} {@ AA = [AA]}
  1536.             ^Userhost $0 -CMD if ([$3]) {
  1537.                 if ([$4] != [<UNKNOWN>])
  1538.                 {
  1539.                     @ UHOST = [$mid(1 $index(@ $3@$4) $mid(${index(! $3@$4)+1} 1000 $3@$4))*$mid(${index(. $3@$4)+1} 1000 $3@$4)]
  1540.                     if (AA == [AA]) {^pp.rmlall FRIENDS *!*$UHOST} {^pp.rml FRIENDS *!*$UHOST $AA}
  1541.                     ^assign -UHOST
  1542.                 } {/echo *** $0 is not on IRC}
  1543.             }
  1544.         }
  1545.     } {/echo *** /rmfriend <nick/umask> [<channel mask>] (can contain wildcards)}
  1546. }
  1547. # /rmenemy <nick/umask> [<channel mask>]
  1548. alias rmenemy {
  1549.     if ([$0])
  1550.     {
  1551.         if (match(*!*@* $0)) {^if ([$1]) {/pp.rml ENEMIES $0 $1} {/pp.rmlall ENEMIES $0}}
  1552.         {
  1553.             if ([$1]) {@ AA = [$1]} {@ AA = [AA]}
  1554.             ^Userhost $0 -CMD if ([$3]) {
  1555.                 if ([$4] != [<UNKNOWN>])
  1556.                 {
  1557.                     @ UHOST = [$mid(1 $index(@ $3@$4) $mid(${index(! $3@$4)+1} 1000 $3@$4))*$mid(${index(. $3@$4)+1} 1000 $3@$4)]
  1558.                     if (AA == [AA]) {^pp.rmlall ENEMIES *!*$UHOST} {^pp.rml ENEMIES *!*$UHOST $AA}
  1559.                     ^assign -UHOST
  1560.                 } {/echo *** $0 is not on IRC}
  1561.             }
  1562.         }
  1563.     } {/echo *** /rmenemy <nick/umask> [<channel mask>] (can contain wildcards)}
  1564. }
  1565.  
  1566. alias nofriends {/rmfriend *!*@*}
  1567. alias noenemies {/rmenemy *!*@*}
  1568.  
  1569. alias lsfriends {
  1570.     echo *** Channel Mask   Patterns
  1571.     if (PP.FRIENDS.CK) {/echo *** [Global (*)]   $PP.FRIENDS.CK}
  1572.     foreach PP.FRIENDS AA {
  1573.         if (AA != [CK])
  1574.         {
  1575.             @ CM = tolower($decode($AA))
  1576.             echo *** $[14]CM $PP.FRIENDS[$AA]
  1577.         }
  1578.     }
  1579.     ^assign -CM
  1580. }
  1581. alias lsenemies {
  1582.     echo *** Channel Mask   Patterns
  1583.     if (PP.ENEMIES.CK) {/echo *** [Global (*)]   $PP.ENEMIES.CK}
  1584.     foreach PP.ENEMIES AA {
  1585.         if (AA != [CK])
  1586.         {
  1587.             @ CM = tolower($decode($AA))
  1588.             echo *** $[14]CM $PP.ENEMIES[$AA]
  1589.         }
  1590.     }
  1591.     ^assign -CM
  1592. }
  1593.  
  1594. # ----------------------------------------------------------------------------
  1595. # Miscellaneous user aliases
  1596. # ----------------------------------------------------------------------------
  1597.  
  1598. # pp.mmsg <PRIVMSG/NOTICE> <who status match> <msg>
  1599. alias pp.mmsg {
  1600.     @ STATP = [$1]
  1601.     ^on ^who * {^if (([$1] != N)&&(match($STATP $2))) {@ MSGNICKS = [$1 ]##MSGNICKS}}
  1602.     @ SEND_TYPE = [$0]
  1603.     @ SEND_MSG = [$2-]
  1604.     //^who *
  1605.     wait -CMD if (1) {
  1606.         ^on who -
  1607.         ^pp.listmsg $SEND_TYPE $MSGNICKS
  1608.         if (SEND_TYPE == [NOTICE])
  1609.         {
  1610.             @ EC.1 = [-]
  1611.             @ EC.2 = [-]
  1612.         }
  1613.         {
  1614.             @ EC.1 = [[]
  1615.             @ EC.2 = []]
  1616.         }
  1617.         if (STATP == [*@*]) {/echo -> ${EC.1}OPS@$C${EC.2} $SEND_MSG} {/echo -> ${EC.1}*@$C${EC.2} $SEND_MSG}
  1618.         ^assign -EC.1
  1619.         ^assign -EC.2
  1620.         ^assign -SEND_TYPE
  1621.         ^assign -SEND_MSG
  1622.         ^assign -MSGNICKS
  1623.         ^assign -STATP
  1624.     }
  1625. }
  1626.  
  1627. # Mass msg'ing aliases
  1628. alias msgall {^if ([$0]) {^pp.mmsg PRIVMSG * $*} {/echo *** /msgall <msg>}}
  1629. alias msgops {^if ([$0]) {^pp.mmsg PRIVMSG *@* $*} {/echo *** /msgops <msg>}}
  1630. alias wallops {^if ([$0]) {^pp.mmsg NOTICE *@* [WallOps:${C}] $*} {/echo *** /wallops <msg> (Use //wallops to use IRC's original wallops command)}}
  1631. alias wall {/wallops $*}
  1632.  
  1633. # So that help servers won't trigger flood protection
  1634. alias help {
  1635.     EVAL ^on -flood "$help_service *" {}
  1636.     EVAL ^timer 60 ^on flood - "$help_service *"
  1637.     //help $*
  1638. }
  1639.  
  1640. alias finger {
  1641.     if ([$0])
  1642.     {
  1643.         if (match(*@* $0)) {/exec $PP.SET.FINGERCMD $0}            
  1644.         {
  1645.             ^Userhost $0 -CMD if ([$3]) {^if ([$3] != [<UNKNOWN>]) {/exec $PP.SET.FINGERCMD $strip(~ $3)@$4} {/echo *** $0 is not on IRC}}
  1646.         }
  1647.     } {/echo *** /finger <nick> -or- /finger <user@host>}
  1648. }
  1649.  
  1650. # Uncompressing /load command
  1651. on ^exec "uncomp *" {/echo *** Output from uncompress program: $1-}
  1652. alias load {
  1653.     if ([$0])
  1654.     {
  1655.         if (right(3 $0) == [.gz]) {@ COMPRESS.ISCOMP = PP.SET.UNGZCMD}
  1656.         if (right(2 $0) == [.Z]) {@ COMPRESS.ISCOMP = PP.SET.UNZCMD}
  1657.         if (COMPRESS.ISCOMP)
  1658.         {
  1659.             ^set input_prompt [$0] Uncompressing and loading...
  1660.             @ COMPRESS.PIPENAME = [/tmp/pptmp]##rand(99999999)
  1661.             @ CMPFILE = [$0]
  1662.             exec -name mknod $PP.SET.MKNODCMD $COMPRESS.PIPENAME p
  1663.             wait -CMD %mknod if (1) {
  1664.                 exec -name uncomp $COMPRESS.ISCOMP $CMPFILE >>$COMPRESS.PIPENAME
  1665.                 //load $COMPRESS.PIPENAME
  1666.                 exec -name rm $PP.SET.RMCMD $COMPRESS.PIPENAME
  1667.                 ^assign -CMPFILE
  1668.                 ^assign -COMPRESS.PIPENAME
  1669.                 ^assign -COMPRESS.ISCOMP
  1670.                 ^set -input_prompt
  1671.             }
  1672.         }
  1673.         {
  1674.             ^set input_prompt [$0] Loading...
  1675.             //load $*
  1676.             ^set -input_prompt
  1677.         }
  1678.     } {//load}
  1679. }
  1680.  
  1681. alias names {^if ([$0]) {//names $*} {/if (ischannel($C)) {//names $C}}}
  1682. alias chops {^if ([$0]) {/who $0 -chops} {/who $C -chops}}
  1683.  
  1684. alias bk {
  1685.     if ([$0])
  1686.     {
  1687.         ^ban $0
  1688.         @ KN = [$0]
  1689.         ^assign KR $1-
  1690.         wait -CMD if (1) {
  1691.             //^kick $C $KN $KR
  1692.             ^assign -KN
  1693.             ^assign -KR
  1694.         }
  1695.     } {/echo *** /bk <nick> [<reason>]}
  1696. }
  1697.  
  1698. alias leave {^if ([$0]) {^if (ischannel($0)) {//leave $*} {//leave #$*}} {//leave $C}}
  1699. alias part {/leave $*}
  1700. alias join {^if ((ischannel($0))||(match(-* $0))) {//join $*} {//join #$*}}
  1701.  
  1702. # Yet another command that is destined to show up in tons of other scripts :)
  1703. # /avoid <nick> or /avoid - <nick> ... just /avoid displays a list
  1704. alias avoid {
  1705.     if ([$0])
  1706.     {
  1707.         if ([$0] == [-])
  1708.         {
  1709.             if ([$1])
  1710.             {
  1711.                 if (match($1 $PP.SET.AVOID))
  1712.                 {
  1713.                     ^delword $1 $PP.SET.AVOID
  1714.                     @ PP.SET.AVOID = NLIST
  1715.                     ^assign -NLIST
  1716.                     echo *** Nick $1 removed from aviodance list
  1717.                 }
  1718.                 {
  1719.                     if ([$1] == [*])
  1720.                     {
  1721.                         ^assign -PP.SET.AVOID
  1722.                         echo *** Avoidance list cleared
  1723.                     } {/echo *** Nick $1 is not on your avoidance list}
  1724.                 }
  1725.             } {/echo *** /avoid - <nick>}
  1726.         }
  1727.         {
  1728.             if (match($1 $PP.SET.AVOID)) {/echo *** Nick $0 is already on your avoidance list}
  1729.             {
  1730.                 @ PP.SET.AVOID = PP.SET.AVOID##[$0 ]
  1731.                 echo *** Nick $0 added to avoidance list
  1732.                 if (!match($0 $PP.SET.NOTIFY)) {^notify $0}
  1733.             }
  1734.         }
  1735.     } {/echo *** Avoidance list: $PP.SET.AVOID}
  1736. }
  1737.  
  1738. alias cstats {
  1739.     @ CSOPS = 0
  1740.     @ CSNOPS = 0
  1741.     @ CSOPERS = 0
  1742.     @ CSHERE = 0
  1743.     @ CSGONE = 0
  1744.     @ CSUCOUNT = 0
  1745.     @ CSFARTHEST = 0
  1746.     ^on ^who * {
  1747.         if (match(*@* $2)) {@ CSOPS = CSOPS + 1} {@ CSNOPS = CSNOPS + 1}
  1748.         if ((mid(1 1 $2) == [*])||(mid(2 1 $2) == [*])) {@ CSOPERS = CSOPERS + 1}
  1749.         if (match(*H* $2)) {@ CSHERE = CSHERE + 1} {@ CSGONE = CSGONE + 1}
  1750.         @ CSUCOUNT = CSUCOUNT + 1
  1751.         if ([$5] > CSFARTHEST) {@ CSFARTHEST = [$5]}
  1752.     }
  1753.     if (ischannel($0)) {@ CSCHAN = [$0]} {@ CSCHAN = C}
  1754.     //^who $CSCHAN
  1755.     wait -CMD if (1) {
  1756.         ^on who -
  1757.         echo *** Stats for channel ${CSCHAN}:
  1758.         echo *** Total Users:${CSUCOUNT}   Ops:${CSOPS}   Non-ops:${CSNOPS}   IRCOps:${CSOPERS}
  1759.         echo *** Here:${CSHERE}   Away:${CSGONE}   Server hops to farthest user:${CSFARTHEST}
  1760.         ^assign -CSOPS
  1761.         ^assign -CSNOPS
  1762.         ^assign -CSCHAN
  1763.         ^assign -CSOPERS
  1764.         ^assign -CSHERE
  1765.         ^assign -CSGONE
  1766.         ^assign -CSUCOUNT
  1767.         ^assign -CSFARTHEST
  1768.     }
  1769. }
  1770.  
  1771. # We alias the notify list so we can keep track of it and save it with /sve
  1772. alias pp.notifychk {
  1773.     if ([$0] == [-]) {^assign -PP.SET.NOTIFY}
  1774.     {
  1775.         @ AA = 0
  1776.         while (word($AA $*))
  1777.         {
  1778.             if (match(-* $word($AA $*)))
  1779.             {
  1780.                 if (PP.SET.NOTIFY)
  1781.                 {
  1782.                     ^delword $mid(1 1000 $word($AA $*)) $PP.SET.NOTIFY
  1783.                     @ PP.SET.NOTIFY = NLIST
  1784.                     ^assign -NLIST
  1785.                 }
  1786.             }
  1787.             {
  1788.                 if (!match($word($AA $*) $PP.SET.NOTIFY)) {@ PP.SET.NOTIFY = PP.SET.NOTIFY##[$word($AA $*) ]}
  1789.             }
  1790.             @ AA = AA + 1
  1791.         }
  1792.     }
  1793. }
  1794. alias notify {
  1795.     //notify $*
  1796.     if ([$0]) {^pp.notifychk $*}
  1797. }
  1798.  
  1799. alias version {
  1800.     if ([$0]) {^if (match(*.* $0)) {//version $*} {//ctcp $0 VERSION}}
  1801.     {
  1802.         //version
  1803.         echo *** PurePak: version $PPVERS
  1804.     }
  1805. }
  1806.  
  1807. alias rwhois {^if ([$0]) {/whois $0 $0} {/whois $N}}
  1808. alias whois {
  1809.     @ WHOISINPROGRESS = 1
  1810.     //whois $*
  1811.     wait -CMD if (1) {^timer 2 ^assign -WHOISINPROGRESS}
  1812. }
  1813.  
  1814. # /nslookup <nick> or /nslookup <ip address>
  1815. alias nslookup {
  1816.     if ([$0])
  1817.     {
  1818.         if (match(*.* $0)) {^pp.dolookup $0}
  1819.         {
  1820.             ^Userhost $0 -CMD if ([$3]) {
  1821.                 if ([$4] != [<UNKNOWN>])
  1822.                 {
  1823.                     if (!isalpha($4)) {^pp.dolookup $4}
  1824.                     {/echo *** $0 is not online as an IP address}
  1825.                 } {/echo *** $0 is not on IRC}
  1826.             }
  1827.         }
  1828.     } {/echo *** /nslookup <nick> -or- /nslookup <ip address>}
  1829. }
  1830. alias pp.dolookup {
  1831.     if (!LOOKINGUP)
  1832.     {
  1833.         exec -name NSLOOKUP $PP.SET.NSLOOKCMD $0
  1834.         @ IPAD = [$0]
  1835.         @ LOOKINGUP = 1
  1836.     }
  1837. }
  1838. on ^exec "NSLOOKUP *" {}
  1839. on ^exec_error "NSLOOKUP *" {}
  1840. on ^exec "NSLOOKUP *Name*" {^pp.gn $*}
  1841. on ^exec_error "NSLOOKUP *Name*" {^pp.gn $*}
  1842. on ^exec_exit "NSLOOKUP *" {
  1843.     if (NSHOST) {/echo *** $IPAD is ${NSHOST}} {/echo *** Could not resolve a hostname for $IPAD}
  1844.     ^assign -NSHOST
  1845.     ^assign -IPAD
  1846.     ^assign -LOOKINGUP
  1847. }
  1848. alias pp.gn {
  1849.     @ AA = 0
  1850.     while (word($AA $*))
  1851.     {
  1852.         if (match(*.* $word($AA $*))) {@ NSHOST = word($AA $*)}
  1853.         @ AA = AA + 1
  1854.     }
  1855. }
  1856.  
  1857. alias ig {
  1858.     if ([$0])
  1859.     {
  1860.         ^Userhost $0 -CMD if ([$3]) {
  1861.             if ([$4] != [<UNKNOWN>]) {/ignore *$strip(~ $3)@$4 MSG NOTICE CTCP PUBLIC} {/echo *** $0 is not on IRC}
  1862.         }
  1863.     } {/echo *** /ig <nick>}
  1864. }
  1865. alias unig {
  1866.     if ([$0])
  1867.     {
  1868.         ^Userhost $0 -CMD if ([$3]) {
  1869.             if ([$4] != [<UNKNOWN>]) {/ignore *$strip(~ $3)@$4 NONE} {/echo *** $0 is not on IRC}
  1870.         }
  1871.     } {/echo *** /unig <nick>}
  1872. }
  1873.  
  1874. alias who {
  1875.     if ((!DOINGWHO)&&(!SYNCING))
  1876.     {
  1877.         ^on ^who * {
  1878.             @ PP.USERS[$WINNUM()][$encode($tolower($0))][$encode($tolower($1))] = [$0 $1 $3@$4]
  1879.             if (match(*@* $2))
  1880.             {
  1881.                 if ((!ischanop($1 $0))&&(!PP.ICWARNED))
  1882.                 {
  1883.                     echo *** Warning: your client's ischanop() function is inaccurate \($1 is op, ischanop() reports not op\)\; channel op status on /users lists may be wrong
  1884.                     @ PP.ICWARNED = 1
  1885.                 }
  1886.             }
  1887.             {
  1888.                 if ((ischanop($1 $0))&&(!PP.ICWARNED))
  1889.                 {
  1890.                     echo *** Warning: your client's ischanop() function is inaccurate \($1 is not op, ischanop() reports op\)\; channel op status on /users lists may be wrong
  1891.                     @ PP.ICWARNED = 1~
  1892.                 }
  1893.             }
  1894.             aw $*
  1895.         }
  1896.         ^if (!PP.EPIC) {^alias aw {/xecho -level CRAP $[10]0 $[9]1 $[3]2 [$[2]5]  $3@$4 \($6-\)}}
  1897.         {^alias aw {/xecho -level CRAP $[10]0 $[9]1 $[3]2 [$[2]6]  $3@$4 \($7-\)}}
  1898.         if ([$0]) {//who $*} {//who *}
  1899.         @ DOINGWHO = 1
  1900.         ^wait -CMD if (1) {
  1901.             ^alias -aw
  1902.             ^on who -
  1903.             ^assign -DOINGWHO
  1904.         }
  1905.     } {^if (SYNCING) {/echo *** /users synchronization in progress\; try again in a few seconds}}
  1906. }
  1907.  
  1908. alias serv {//server $*}
  1909. alias umode {//mode $N $*}
  1910.  
  1911. # Unflash command that should work on ALL clients
  1912. alias unflash {
  1913.     if (V <= 19930629)
  1914.     {
  1915.         ^set status_clock c
  1916.         ^type ^L
  1917.         ^set status_clock \;\24r
  1918.         ^type ^L
  1919.         ^set status_clock m
  1920.         ^type ^L
  1921.         ^set status_clock ?5l
  1922.         ^type ^L
  1923.         sleep 1
  1924.         ^set status_clock  %T
  1925.         ^type ^L
  1926.         echo *** Screen restored
  1927.     }
  1928.     {
  1929.         if ([$TTY])
  1930.         {
  1931.             if (match(*/* $TTY)) {^assign MYTTY $TTY} {^assign MYTTY /dev/$TTY}
  1932.             ^exec -name unflash echo c >>$MYTTY
  1933.             ^exec -name unflash echo \\\;\24r >>$MYTTY
  1934.             ^exec -name unflash echo m >>$MYTTY
  1935.             ^exec -name unflash echo ?5l >>$MYTTY
  1936.             ^exec -name unflash reset >>$MYTTY
  1937.             wait -CMD %unflash if (1) {
  1938.                 ^type ^L
  1939.                 ^assign -MYTTY
  1940.                 echo *** Screen restored
  1941.             }
  1942.         } {/echo *** UNFLASH FAILED: ENVIRONMENT VARIABLE 'TTY' MUST BE SET TO YOUR TTY.  SEE README.PPK}
  1943.     }
  1944. }
  1945.  
  1946. alias mail {
  1947.     if ([$0])
  1948.     {
  1949.         ^assign MAILFILE $1-
  1950.         ^Userhost $0 -CMD if ([$3]) {
  1951.             if ([$3] != [<UNKNOWN>])
  1952.             {
  1953.                 exec $PP.SET.MAILCMD $strip(~ $3)@$4 < $MAILFILE
  1954.                 echo *** Mailed $MAILFILE to $strip(~ $3)@$4
  1955.                 ^assign -MAILFILE
  1956.             } 
  1957.             {
  1958.                 echo *** $0 is not on IRC
  1959.                 ^assign -MAILFILE
  1960.             }
  1961.         }
  1962.     } {/echo *** /mail <nick> <file>}
  1963. }
  1964. alias uumail {
  1965.     if ([$0]) {
  1966.         ^assign MAILFILE $1-
  1967.         ^Userhost $0 -CMD if ([$3]) {
  1968.             if ([$3] != [<UNKNOWN>])
  1969.             {
  1970.                 exec $PP.SET.UUECMD $MAILFILE $MAILFILE | $PP.SET.MAILCMD $strip(~ $3)@$4
  1971.                 echo *** Mailed $MAILFILE to $strip(~ $3)@$4 (uuencoded)
  1972.                 ^assign -MAILFILE
  1973.             }
  1974.             {
  1975.                 echo *** $0 is not on IRC
  1976.                 ^assign -MAILFILE
  1977.             }
  1978.         }
  1979.     } {/echo *** /uumail <nick> <file>}
  1980. }
  1981.  
  1982. alias topic {^if (ischannel($0)) {//topic $*} {//topic $C $*}}
  1983.  
  1984. alias net {
  1985.     if ([$0])
  1986.     {
  1987.         echo *** Creating a window on server $0
  1988.         echo *** Type ^W to switch between windows and /wk to kill the current window.
  1989.         window new
  1990.         if ([$1]) {/EVAL window server $0:$1::_$N} {/EVAL window server $0:6667::_$N}
  1991.     }
  1992.     {
  1993.         echo *** /net <server> [<port>]
  1994.         echo ***
  1995.         echo *** /net creates a new window and connects it to <server>.  To
  1996.         echo *** switch windows, hit ^W
  1997.         echo ***
  1998.         echo *** /wk kills the current window.
  1999.         echo *** /wh hides the current window.
  2000.         echo *** /ws shows all windows.
  2001.     }
  2002. }
  2003. alias wk {/window kill}
  2004. alias wh {/window hide}
  2005. alias ws {
  2006.     window show 2
  2007.     window show 1
  2008.     window balance
  2009. }
  2010.  
  2011. alias massinv {
  2012.     if ([$0])
  2013.     {
  2014.         ^on ^who * {
  2015.             if (([$1] != N)&&([$0] != C)) {/EVAL ^timer $rand(30) //invite $1 $C}
  2016.         }
  2017.         echo *** Inviting users found with command '/who $*' to channel $C
  2018.         //^who $*
  2019.         wait -CMD ^on who -
  2020.     } {/echo *** /massinv <who params>   - Where <who params> is exactly as if it were a /who command.}
  2021. }
  2022.     
  2023. alias cycle {lj}
  2024. alias lj {
  2025.     @ OC = C
  2026.     //leave $C
  2027.     wait -CMD if (1) {
  2028.         //join $OC
  2029.         ^assign -OC
  2030.     }
  2031. }
  2032.  
  2033. alias signoff {
  2034.     if ([$0])
  2035.     {
  2036.         echo *** Signoff: $N \($*\)
  2037.         //signoff $*
  2038.     }
  2039.     {
  2040.         echo *** Signoff: $N \(Leaving\)
  2041.         //signoff Leaving
  2042.     }
  2043. }
  2044. alias exit {/signoff $*}
  2045. alias quit {/signoff $*}
  2046. alias bye {/signoff $*}
  2047.  
  2048. alias ls {/exec $PP.SET.LSCMD $*}
  2049. alias lsw {
  2050.     @ OLDTABMAX = TAB_MAX
  2051.     ^set TAB_MAX 64
  2052.     exec -name lsw $PP.SET.LSWCMD $*
  2053.     wait -CMD %lsw if (1) {
  2054.         ^set TAB_MAX $OLDTABMAX
  2055.         ^assign -OLDTABMAX
  2056.     }
  2057. }
  2058. alias rm {^if ([$0]) {/exec $PP.SET.RMCMD $*} {/echo *** /rm [<rm options>] <filenames>}}
  2059. alias cat {^if ([$0]) {/exec $PP.SET.CATCMD $*} {/echo *** /cat <filename>}}
  2060. on ^exec "MSGCAT *" {
  2061.     if (!match(=* $MCAT))
  2062.     {
  2063.         ^timer $MCATCTR //msg $MCAT $1-
  2064.         @ MCATCTR = MCATCTR + (rand(2) + 1)
  2065.     } {//msg $MCAT $1-}
  2066. }
  2067. on ^exec_exit "MSGCAT *" {
  2068.     ^assign -MCAT
  2069.     ^assign -MCATCTR
  2070. }
  2071. alias catto {
  2072.     if ([$1])
  2073.     {
  2074.         @ MCAT = [$0]
  2075.         @ MCATCTR = 2
  2076.         exec -name MSGCAT $PP.SET.CATCMD $1
  2077.     }
  2078.     {^if ([$0]) {/catto $C $0} {/echo *** /catto <nick/channel> <file> -or- /catto <file> (goes to current channel)}}
  2079. }
  2080. alias ps {/exec $PP.SET.PSCMD $*}
  2081. alias pskill {^if ([$0]) {/exec $PP.SET.KILLCMD $*} {/echo *** /pskill <pid(s) to kill>}}
  2082.  
  2083. alias pp.awaylog {
  2084.     ^assign AWAYLOG[$PP.AWAYLCTR] $*
  2085.     if (PBFILE) {^pp.playback $*}
  2086.     @ PP.AWAYLCTR = PP.AWAYLCTR + 1
  2087. }
  2088. alias pp.pe {^if (PBFILE) {^msg %pbfile $strip( $*)} {/echo $*}}
  2089. alias pp.playback {
  2090.     if ([$1] == [MSG]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] [$3!$strip(~ $2)] $4-}
  2091.     if ([$1] == [NOTICE]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] -$3!$strip(~ $2)- $4-}
  2092.     if ([$1] == [KICK]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] Kicked from $4 by $3 [$strip(~ $2)] \($5-\)}
  2093.     if ([$1] == [BAN]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] $3 [$strip(~ $2)] banned you from $4 with bans: $5-}
  2094.     if ([$1] == [FLOOD]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] $4- from $3 [$strip(~ $2)] detected}
  2095.     if ([$1] == [DEOP]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] $3 [$strip(~ $2)] deopped you on $4}
  2096.     if ([$1] == [OP]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] $3 [$strip(~ $2)] opped you on $4}
  2097.     if ([$1] == [DCC]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] DCC $4 \($5\) received from $2 [$strip(~ $3)]}
  2098. }
  2099. alias playback {
  2100.     if (AWAYLOG[0])
  2101.     {
  2102.         if (PBFILE)
  2103.         {
  2104.             @ PBFILE_OLD = PBFILE
  2105.             ^assign -PBFILE
  2106.         }
  2107.         @ CTR = 0
  2108.         ^pp.pauseset
  2109.         while (CTR <= PP.AWAYLCTR)
  2110.         {
  2111.             ^pp.playback $AWAYLOG[$CTR]
  2112.             @ CTR = CTR + 1
  2113.         }
  2114.         ^pp.pauseend
  2115.         ^assign -CTR
  2116.         if (PBFILE_OLD)
  2117.         {
  2118.             @ PBFILE = PBFILE_OLD
  2119.             ^assign -PBFILE_OLD
  2120.         }
  2121.     } {/echo *** No messages or events to play back}
  2122. }
  2123. alias clearlog {
  2124.     foreach AWAYLOG AA {^assign -AWAYLOG[$AA]}
  2125.     @ PP.AWAYLCTR = 0
  2126.     echo *** Away log is now empty
  2127. }
  2128.             
  2129. alias away {
  2130.     if (!(A))
  2131.     {
  2132.         if ([$0]) {//away $*}
  2133.         {
  2134.             if (index(G $PP.SET) >= 0) {//away All messages will be logged...} {//away Gone...}
  2135.         }
  2136.         wait -CMD if (1) {
  2137.             if ((!!(C))&&(index(O $PP.SET) >= 0))
  2138.             {
  2139.                 ^assign SEND_MSG ACTION is away: ${A}
  2140.                 ^pp.listmsg PRIVMSG $mychannels()
  2141.                 ^assign -SEND_MSG
  2142.                 echo * $N is away: $A
  2143.             }
  2144.         }
  2145.         if (index(H $PP.SET) >= 0)
  2146.         {
  2147.             ^assign PBFILE $PP.SET.ALFILE
  2148.             ^exec -name pbfile $PP.SET.CATCMD >>$PBFILE
  2149.             echo *** Away log file ${PBFILE} opened
  2150.         }
  2151.         @ PP.AWAYSINCE = Z
  2152.     }
  2153.     {
  2154.         //away
  2155.         wait -CMD if (1) {
  2156.             ^assign -PP.AWAYSINCE
  2157.             if (index(G $PP.SET) >= 0) {/echo *** Type /playback to play back away log, type /clearlog to clear away log.}
  2158.             if ((!!(C))&&(index(O $PP.SET) >= 0))
  2159.             {
  2160.                 ^assign SEND_MSG ACTION is back.
  2161.                 ^pp.listmsg PRIVMSG $mychannels()
  2162.                 ^assign -SEND_MSG
  2163.                 echo * $N is back.
  2164.             }
  2165.         }
  2166.         if (index(H $PP.SET) >= 0)
  2167.         {
  2168.             ^exec -close %pbfile
  2169.             echo *** Away log file ${PBFILE} closed
  2170.             ^assign -PBFILE
  2171.         }
  2172.     }
  2173. }
  2174.  
  2175. # paway <nick> <msg/->
  2176. alias paway {
  2177.     if ([$0])
  2178.     {
  2179.         if ([$1])
  2180.         {
  2181.             if ([$1] == [-])
  2182.             {
  2183.                 ^assign -PP.PAWAYS[$encode($toupper($0))]
  2184.                 echo *** Personal away message for $0 removed
  2185.             }
  2186.             {
  2187.                 @ PP.PAWAYS[$encode($toupper($0))] = [$1-]
  2188.                 echo *** Personal away message for $0 added: $1-
  2189.             }
  2190.         }
  2191.         {
  2192.             if (PP.PAWAYS[$encode($toupper($0))]) {/echo *** Personal away message for $0: $PP.PAWAYS[$encode($toupper($0))]}
  2193.             {/echo *** No personal away message set for $0}
  2194.         }
  2195.     }
  2196.     {
  2197.         echo *** Nick       Message
  2198.         foreach PP.PAWAYS AA {/echo *** $[10]decode($AA) $PP.PAWAYS[$AA]}
  2199.     }
  2200. }
  2201.  
  2202. alias write {/comment $write($*)}
  2203. alias sve {
  2204.     if (!(HOME))
  2205.     {
  2206.         exec -name rm $PP.SET.RMCMD $PP.SAVEFILE
  2207.         echo *** Warning: Your home directory could not be determined.  Your saved settings file will be saved to the current working directory.  If this isn't your home directory, PurePak may not be able to find it's saved settings file at startup!
  2208.     } {/exec -name rm $PP.SET.RMCMD ${HOME}/$PP.SAVEFILE}
  2209.     wait -CMD %rm if (1) {
  2210.         if (PP.EPIC)
  2211.         {
  2212.             if (!(HOME)) {@ FHANDLE = open($PP.SAVEFILE w)} {@ FHANDLE = open(${HOME}/$PP.SAVEFILE w)}
  2213.             if (FHANDLE > 0) {/EVAL ^assign WM /write $FHANDLE}
  2214.             {
  2215.                 echo *** Could not open target file!
  2216.                 @ WM = [/comment]
  2217.             }
  2218.         }
  2219.         {
  2220.             @ WM = [/xecho -WINDOW WRITEOUT]
  2221.             ^window new
  2222.             ^window hold_mode off
  2223.             ^window name WRITEOUT
  2224.             if (!(HOME)) {^window logfile $PP.SAVEFILE} {^window logfile ${HOME}/$PP.SAVEFILE}
  2225.             ^window log on
  2226.         }
  2227.         $WM # PurePak version $PPVERS saved settings file
  2228.         $WM # Written $stime($time())
  2229.         foreach PP.SET AA {$WM @ PP.SET.$AA = [$PP.SET[$AA]]}
  2230.         foreach PP.PAWAYS AA {$WM @ PP.PAWAYS.$AA = [$PP.PAWAYS[$AA]]}
  2231.         $WM @ PP.SET = [$PP.SET]
  2232.         $WM ^set beep_on_msg $beep_on_msg
  2233.         $WM ^set flood_rate $flood_rate
  2234.         $WM ^set flood_after $flood_after
  2235.         $WM ^set shell $shell
  2236.         $WM ^set suppress_server_motd $suppress_server_motd
  2237.         foreach PP.FRIENDS AA {$WM @ PP.FRIENDS[$AA] = [$PP.FRIENDS[$AA]]}
  2238.         foreach PP.ENEMIES AA {$WM @ PP.ENEMIES[$AA] = [$PP.ENEMIES[$AA]]}
  2239.         $WM ^pp.savedfrom $strip(.ba $PPVERS)
  2240.         $WM echo *** Saved settings loaded from ${PP.SAVEFILE}
  2241.         if (match(*xecho* $WM))
  2242.         {
  2243.             ^window log off
  2244.             ^window kill
  2245.         }
  2246.         {
  2247.             comment $close($FHANDLE)
  2248.             ^assign -FHANDLE
  2249.         }
  2250.         ^assign -WM
  2251.         echo *** Current settings saved to ${PP.SAVEFILE}
  2252.     }
  2253. }
  2254. alias pp.savedfrom {
  2255.     if ([$0] < 109)
  2256.     {
  2257.         ^alias echo {}
  2258.         foreach FRIENDS AA {
  2259.             ^pp.addl FRIENDS $FRIENDS[$AA] *
  2260.             ^assign -FRIENDS[$AA]
  2261.         }
  2262.         foreach ENEMIES AA {
  2263.             ^pp.addl ENEMIES $ENEMIES[$AA] *
  2264.             ^assign -ENEMIES[$AA]
  2265.         }
  2266.         ^alias -echo
  2267.         ^timer 30 /echo *** Your old friends/enemies lists from your previous version of PurePak have been added to the 'global' friends/enemies lists in this version.  You should /sve now to save the lists in the new format. (Type /lsfriends and /lsenemies to check your lists)
  2268.     }
  2269.     if ([$0] < 205)
  2270.     {
  2271.         foreach PP.PAWAYS AA {
  2272.             @ PP.PAWAYS[$encode($toupper($AA))] = PP.PAWAYS[$AA]
  2273.             ^assign -PP.PAWAYS[$AA]
  2274.             ^timer 30 /echo *** There have been changes to the saved file format.  Auto-converted, but you should /sve now so you don't see this message again.
  2275.         }
  2276.     }
  2277.     ^timer 5 ^alias -pp.savedfrom
  2278. }
  2279.  
  2280. # So the "IRC log started ..." comments in the logfile do nothing
  2281. alias IRC {}
  2282. alias pphelp {
  2283.     if ([$0]) {
  2284.         if (!(PPHELP.HELP)) 
  2285.         {
  2286.             ^set input_prompt Loading help database...
  2287.             //^load purepak.hlp
  2288.             ^set -input_prompt
  2289.             if (!(PPHELP.HELP)) {/echo *** Error loading purepak.hlp: check to make sure that the file exists and is in a directory where it can be found.} {/pphelp $*}
  2290.         }
  2291.         {
  2292.             @ PP.HELPLASTUSED = time()
  2293.             if ([$1]) {@ EN = [$0_$1]} {@ EN = [$0]}
  2294.             if (!(PPHELP[$EN][0])) {/echo *** No help available on '$*'}
  2295.             {
  2296.                 ^pp.pauseset
  2297.                 echo *** Help: $*
  2298.                 foreach PPHELP.$EN AA {/echo -- $PPHELP[$EN][$AA]}
  2299.                 echo --
  2300.                 ^pp.pauseend
  2301.             }
  2302.             ^assign -EN
  2303.         }
  2304.     } {/pphelp HELP}
  2305. }
  2306.  
  2307. alias lockmode {
  2308.     if ([$0])
  2309.     {
  2310.         if (!ischannel($0)) {/echo *** /lockmode <#channel> <mode(s) to lock/off>}
  2311.         {
  2312.             if ([$1])
  2313.             {
  2314.                 if ([$1] == [OFF])
  2315.                 {
  2316.                     if (!(LOCKEDMODES[$encode($0)])) {/echo *** No modes are locked on $0}
  2317.                     {
  2318.                         ^assign -LOCKEDMODES[$encode($0)]
  2319.                         if (gotops($0))
  2320.                         {
  2321.                             if (index(W $PP.SET) >= 0)
  2322.                             {
  2323.                                 if ([$0] == C) {/me : Mode no longer locked} {/describe $0 : Mode no longer locked}
  2324.                             }
  2325.                         }
  2326.                         echo *** Mode on channel $0 no longer locked
  2327.                     }
  2328.                 }
  2329.                 {
  2330.                     if (rmatch($1 *-* *o* *v*)) {/echo *** Cannot lock that mode.  /pphelp lockmode for help.}
  2331.                     {
  2332.                         ^assign LOCKEDMODES[$encode($0)] $1-
  2333.                         if (gotops($0))
  2334.                         {
  2335.                             if (index(W $PP.SET) >= 0)
  2336.                             {
  2337.                                 if ([$0] == C) {/me : Mode locked to: $1-} {/describe $0 : Mode locked to: $1-}
  2338.                             }
  2339.                             ^clearmode $0
  2340.                             EVAL ^on #^mode 2 * {//mode $1 $LOCKEDMODES[$encode($1)];^on #mode 2 - *}
  2341.                         } {/echo *** Warning: you don't have ops on $0!}
  2342.                         echo *** Mode on channel $0 locked to: $1-
  2343.                     }
  2344.                 }
  2345.             } {/echo *** /lockmode <#channel> <mode(s) to lock/off>}
  2346.         }
  2347.     }
  2348.     {
  2349.         echo *** Channels/modes currently locked:
  2350.         foreach LOCKEDMODES AA {/echo *** Channel: $decode($AA)   Mode: $LOCKEDMODES[$AA]}
  2351.     }
  2352. }
  2353.  
  2354. alias pp.last {/sendto $0 [$2!$strip(~ $1)] $3-}
  2355. alias pp.lastn {/sendto $0 -$2!$strip(~ $1)- $3-}
  2356. # User /last and /lastn commands
  2357. alias last {^if ([$0]) {/pp.last $0 $PP.LMSG} {/pp.last $C $PP.LMSG}}
  2358. alias lastn {^if ([$0]) {/pp.lastn $0 $PP.LNOTICE} {/pp.lastn $C $PP.LNOTICE}}
  2359.  
  2360. # ----------------------------------------------------------------------------
  2361. # Standard on handlers
  2362. # ----------------------------------------------------------------------------
  2363.  
  2364. # Don't show error notices from deop*4's from old servers
  2365. on ^401 "% % No such nick (channel)" {}
  2366.  
  2367. # Make names look like it does when you join a channel
  2368. on ^names * {/echo *** Users on $0: $1-}
  2369.  
  2370. on ^send_public * {
  2371.     if ([$0] == C) {/echo <${N}> $1-}
  2372.     {
  2373.         echo -> $0 <${N}> $1-
  2374.         ^tk.addmsg $0 $tk.msglist
  2375.     }
  2376. }
  2377. on ^send_msg * {
  2378.     ^pp.formecho $PP.SET.MSFORMAT $0 X $1-
  2379.     ^tk.addmsg $0 $tk.msglist
  2380. }
  2381. on ^send_notice * {
  2382.     ^pp.formecho $PP.SET.NSFORMAT $0 X $1-
  2383.     ^tk.addmsg $0 $tk.msglist
  2384. }
  2385. on -send_dcc_chat * {^tk.addmsg =$0 $tk.msglist}
  2386.  
  2387. # Checks to see if a message contains any known floods
  2388. alias pp.fp.msgsafe {
  2389.     @ FUNCTION_RETURN = 1
  2390.     if (index(F $PP.SET) >= 0)
  2391.     {
  2392.         if (match(**** $*)) {@ FUNCTION_RETURN = 0}
  2393.         {
  2394.             ^if (rindex($right(1 $0) $0) >= PP.SET.JFLEN) {@ FUNCTION_RETURN = 0}
  2395.             {
  2396.                 ^if (left(10 $*) == [         ]) {@ FUNCTION_RETURN = 0}
  2397.             }
  2398.         }
  2399.     }
  2400. }
  2401.  
  2402. # Public flood/tsunami filters
  2403. alias pp.fp.pubecho {^if ([$1] == C) {/echo <$0> $2-} {/echo <$0:$1> $2-}}
  2404. on ^public "% % *****" {
  2405.     if (index(F $PP.SET) >= 0) {/pp.fp.pubecho $0 $1 [flood detected]} {/pp.fp.pubecho $*}
  2406.     if (PP.SET.CHANPROT) {//kick $1 $0 [Possible beep/tsunami flood]}
  2407. }
  2408. on ^public_notice "% % *****" {
  2409.     if (index(F $PP.SET) >= 0) {/echo -$0:${1}- [flood detected]} {/echo -$0:${1}- $2-}
  2410.     if (PP.SET.CHANPROT) {//kick $1 $0 [Possible beep/tsunami flood]}
  2411. }
  2412. on ^public_msg "% % *****" {
  2413.     if (index(F $PP.SET) >= 0) {/echo \($0/$1\) [flood detected]} {/echo \($0/$1\) $2-}
  2414.     if (PP.SET.CHANPROT) {//kick $1 $0 [Possible beep/tsunami flood]}
  2415. }
  2416.  
  2417. # Msg and notice handlers
  2418. on ^msg * {
  2419.     if (pp.fp.msgsafe($1-))
  2420.     {
  2421.         pp.formecho $PP.SET.MRFORMAT $0 $strip(~ $USERHOST()) $1-
  2422.         ^tk.addmsg $0 $tk.msglist
  2423.     } {/pp.formecho $PP.SET.MRFORMAT $0 $strip(~ $USERHOST()) [flood detected]}
  2424.     ^assign PP.LMSG $USERHOST() $*
  2425.     if ((!!(A))&&(index(G $PP.SET) >= 0))
  2426.     {
  2427.         if ((index(W $PP.SET) >= 0)&&(!match($0 $LAWAYN)))
  2428.         {
  2429.             if ([$0] != N) {
  2430.                 if (!PP.PAWAYS[$encode($toupper($0))]) {//^notice $0 [PurePak] I am away... Messages are being logged  [since ${PP.AWAYSINCE}]}
  2431.                 {//^notice $0 [AWAY] $PP.PAWAYS[$encode($toupper($0))]  [since ${PP.AWAYSINCE}]}
  2432.             }
  2433.             if (!(LAWAYN)) {^timer 120 ^assign -LAWAYN}
  2434.             @ LAWAYN = [$0 ]##LAWAYN
  2435.         }
  2436.         ^pp.awaylog $time() MSG $USERHOST() $*
  2437.     }
  2438. }
  2439. on ^notice * {
  2440.     if (pp.fp.msgsafe($1-))
  2441.     {
  2442.         pp.formecho $PP.SET.NRFORMAT $0 $strip(~ $USERHOST()) $1-
  2443.         if (!rmatch($0 Help_* *@* *srv Irc*Help *bot *s?rv *b0t *.*)) {^tk.addmsg $0 $tk.msglist}
  2444.     } {/pp.formecho $PP.SET.NRFORMAT $0 $strip(~ $USERHOST()) [flood detected]}
  2445.     @ PP.LNOTICE = [$USERHOST() $*]
  2446.     if ((!!(A))&&(index(G $PP.SET) >= 0)) {^pp.awaylog $time() NOTICE $USERHOST() $*}
  2447. }
  2448.  
  2449. # pp.formecho encode(<format>) <nick> <user@host> <msg>
  2450. # Speed improved by Tris, Speed improved still more by CKeeper
  2451. alias pp.formecho {
  2452.     @ AA = 0
  2453.     @ AB = decode($0)
  2454.     @ AC = mid(0 1 $AB)
  2455.     while (AC)
  2456.     {
  2457.         if (!strip(NUMT $AC))
  2458.         {
  2459.             if (AC == [N]) {@ AD = AD##[$1]}
  2460.             {if (AC == [U]) {@ AD = AD##[$2]}
  2461.             {if (AC == [M]) {@ AD = AD##[$3-]}
  2462.             {if (AC == [T]) {@ AD = AD##[<$word(3 $stime($time()))>]}}}}
  2463.         } {@ AD = AD##AC}
  2464.         @ AA = AA + 1
  2465.         @ AC = mid($AA 1 $AB)
  2466.     }
  2467.     echo $AD
  2468.     ^assign -AC
  2469.     ^assign -AD
  2470. }
  2471.  
  2472. # Make some notices look better and be more informative
  2473. on ^482 * {^if ([$0] != S) {/echo *** You are desynched on $1 \(from server $0\)} {/echo *** You are not channel operator on $1}}
  2474. on ^442 * {^if ([$0] != S) {^if (match($1 $mychannels())) {/echo *** You are desynched: server $0 doesn't think you are on channel $1} {/echo *** You are not on channel $1 \(from server $0\)}} {/echo *** You are not on channel $1}}
  2475. on ^465 * {/echo *** You are banned (K-lined) from server $0}
  2476. on ^333 * {^if (!match(*.* $2)) {/echo *** Topic was set on $1 by $2 at $stime($3)}}
  2477. on ^375 * {^if ((suppress_server_motd != [ON])||(PP.SEENMOTD)) {/echo ++ $1-}}
  2478. on ^372 * {^if ((suppress_server_motd != [ON])||(PP.SEENMOTD)) {/echo -- $1-}}
  2479. on ^376 * {@ PP.SEENMOTD = 1}
  2480. EVAL ^if (PP.EPIC) {
  2481.     on ^323 * {}
  2482.     on ^376 * {}
  2483.     on ^219 * {}
  2484. }
  2485. on ^leave * {/xecho -level CRAP *** $0 has left channel $1}
  2486. on ^channel_signoff * {/xecho -level CRAP *** Signoff: $1 \($2-\) [$0]}
  2487.  
  2488. # Suppress annoying (and meaningless) "dgets timed out" notices
  2489. on ^window "% ??? *dgets timed out.*continuing*" {}
  2490. # And there's a typo in the client too!
  2491. on ^window "% ??? *dgets tiomed out.*continuing*" {}
  2492.  
  2493. # Don't show notices that you are away unless /whois'ing yourself
  2494. on ^window "% ??? % is away: *" {^if (([$2] != N)||(WHOISINPROGRESS)) {/echo $1-}}
  2495.  
  2496. # Anything to be done on join, like friends/enemies list checking
  2497. on #-join 2 * {
  2498.     if (gotops($1))
  2499.     {
  2500.         if (index(L $PP.SET) >= 0)
  2501.         {
  2502.             if (ispal($0!$USERHOST() $1))
  2503.             {
  2504.                 ^timer 2 /echo *** $0 is on your friends list: auto-opping on $1
  2505.                 //mode $1 +o $0
  2506.             }
  2507.         }
  2508.         if (index(E $PP.SET) >= 0)
  2509.         {
  2510.             if (isshit($0!$USERHOST() $1))
  2511.             {
  2512.                 ^timer 2 /echo *** $0 is on your enemies list: auto-bkicking off $1
  2513.                 //mode $1 -o+b $0 *!*$mid(1 1000 $USERHOST())
  2514.                 //kick $1 $0 [Auto-BKick]
  2515.             }
  2516.         }
  2517.         if ((index(C $PP.SET) >= 0)&&(!match($0 $PP.BOTNICKS $PP.CLONES)))
  2518.         {
  2519.             @ JHOST = mid(${index(@ $USERHOST())+1} $rindex($right(1 $USERHOST()) $USERHOST()) $USERHOST())
  2520.             if ([$JHOST$1] == LASTJHOST)
  2521.             {
  2522.                 @ PP.CPCTR = PP.CPCTR + 1
  2523.                 if (PP.CPCTR >= PP.SET.CPSENS)
  2524.                 {
  2525.                     //mode $1 +b *!*@$JHOST
  2526.                     wait -CMD ^pp.mkick $1 *@$JHOST [Clonebots Detected]
  2527.                     echo *** Clonebot mass-join protection engaged on $1 for bots at ${JHOST}
  2528.                     @ PP.CPCTR = 0
  2529.                 }
  2530.             }
  2531.             if (!(LASTJHOST))
  2532.             {
  2533.                 ^timer 4 ^assign -LASTJHOST
  2534.                 ^timer 4 @ PP.CPCTR = 0
  2535.             }
  2536.             @ LASTJHOST = JHOST##[$1]
  2537.             ^assign -JHOST
  2538.         }
  2539.     }
  2540.     if ((PP.SET.LOOKJOIN)&&(!LOOKINGUP))
  2541.     {
  2542.         if (!isalpha($mid(${index(@ $USERHOST())+1} 1000 $USERHOST())))
  2543.         {
  2544.             ^nslookup $mid(${index(@ $USERHOST())+1} 1000 $USERHOST())
  2545.         }
  2546.     }
  2547.     if (match($0 $PP.SET.AVOID))
  2548.     {
  2549.         echo *** Automatic avoiding engaged for $0: setting away
  2550.         if (!(A))
  2551.         {
  2552.             if (index(O $PP.SET) >= 0)
  2553.             {
  2554.                 @ OLD_PPSET = PP.SET
  2555.                 @ PP.SET = strip(O $PP.SET)
  2556.                 ^away bbl...
  2557.                 wait -CMD if (1) {
  2558.                     @ PP.SET = OLD_PPSET
  2559.                     ^assign -OLD_PPSET
  2560.                 }
  2561.             } {^away bbl...}
  2562.         }
  2563.     }
  2564.     if ([$0] != N) {^assign UHOSTCACHE[$encode($0)] $USERHOST()}
  2565. }
  2566.  
  2567. # Fetches a user@host from the user@host cache
  2568. alias getuh {^foreach UHOSTCACHE AA {^if (decode($AA) == [$0]) {@ FUNCTION_RETURN = UHOSTCACHE[$AA]}}}
  2569.     
  2570. on -raw_irc "% KICK *" {
  2571.     ^assign KNICK $nickonly($0)
  2572.     if ([$3] == N)
  2573.     {
  2574.         if ((!!(A))&&(index(G $PP.SET) >= 0)) {^pp.awaylog $time() KICK $mid(${index(! $0)+1} $rindex($right(1 $0) $0) $0) $KNICK $2 $strip(: $4) $5-}
  2575.         if (index(J $PP.SET) >= 0) {/EVAL ^timer 2 //^quote JOIN $2}
  2576.     }
  2577.     if ((index(M $PP.SET) >= 0)&&(gotops($2)))
  2578.     {
  2579.         if (([$0$2] == LASTKICKER)&&(!rand(4)))
  2580.         {
  2581.             if (!PP.SET.MASSRESP)
  2582.             {
  2583.                 //mode $2 -o $KNICK
  2584.                 if (index(W $PP.SET) >= 0) {^notice $KNICK [PurePak] Masskick on channel $2 from you detected}
  2585.             } {//kick $2 $KNICK [Masskick detected]}
  2586.             echo *** Masskick protection activated by ${KNICK} on $2
  2587.         }
  2588.         if (KNICK != N)
  2589.         {
  2590.             if (!(LASTKICKER)) {^timer 3 ^assign -LASTKICKER}
  2591.             @ LASTKICKER = [$0$2]
  2592.         }
  2593.     }
  2594.     if (PP.BOTS) {/bots.onkick $*}
  2595.     ^assign -KNICK
  2596. }
  2597.  
  2598. # Way too much crap is done here :P
  2599. on -mode "% #% *" {
  2600.     if ((index(M $PP.SET) >= 0)&&([$0] != N))
  2601.     {
  2602.         if ((gotops($1))&&(!match($0 $PP.BOTNICKS $PP.CLONES)))
  2603.         {
  2604.             if ((rmatch($2 *-ooo* *+o-o+o* *-o+o-o*))&&([$0] != LASTMASSER))
  2605.             {
  2606.                 if (!PP.SET.MASSRESP)
  2607.                 {
  2608.                     //mode $1 -o $0
  2609.                     if (index(W $PP.SET) >= 0) {^notice $0 [PurePak] Massdeop on channel $1 from you detected}
  2610.                 } {//kick $1 $0 [Massdeop detected]}
  2611.                 echo *** Massdeop protection activated by $0 on $1
  2612.                 ^assign LASTMASSER $0
  2613.                 ^timer 10 ^assign -LASTMASSER
  2614.             }
  2615.             {
  2616.                 if (match(*-o* $2))
  2617.                 {
  2618.                     if (([$0$1] == LASTDEOP)&&([$0] != LASTMASSER))
  2619.                     {
  2620.                         if (!PP.SET.MASSRESP)
  2621.                         {
  2622.                             //mode $1 -o $0
  2623.                             if (index(W $PP.SET) >= 0) {^notice $0 [PurePak] Massdeop on channel $1 from you detected}
  2624.                         } {//kick $1 $0 [Massdeop detected]}
  2625.                         echo *** Massdeop protection activated by $0 on $1
  2626.                         ^assign LASTMASSER $0
  2627.                         ^timer 10 ^assign -LASTMASSER
  2628.                     }
  2629.                     if (!(LASTDEOP)) {^if (match(*-oo* $2)) {^timer 4 ^assign -LASTDEOP} {^timer 2 ^assign -LASTDEOP}}
  2630.                     ^assign LASTDEOP $0$1
  2631.                 }
  2632.             }
  2633.         }
  2634.     }
  2635.     if ((match(*.* $0))&&(index(S $PP.SET) >= 0))
  2636.     {
  2637.         if ((match(*+o* $2))&&(gotops($1)))
  2638.         {
  2639.             if ((!match(*@* $3))&&(isalpha($3))) {^if (!ispal($3!$getuh($3) $1)) {@ SERVOPD = [$3]} {@ EXCLUDED = [$3]}}
  2640.             if ([$4]) {^if ((!match(*@* $4))&&(isalpha($4))) {^if (!ispal($4!$getuh($4) $1)) {^assign SERVOPD $4 $SERVOPD} {^assign EXCLUDED $4 $EXCLUDED}}}
  2641.             if ([$5]) {^if ((!match(*@* $5))&&(isalpha($5))) {^if (!ispal($5!$getuh($5) $1)) {^assign SERVOPD $5 $SERVOPD} {^assign EXCLUDED $5 $EXCLUDED}}}
  2642.             if ([$6]) {^if ((!match(*@* $6))&&(isalpha($6))) {^if (!ispal($6!$getuh($6) $1)) {^assign SERVOPD $6 $SERVOPD} {^assign EXCLUDED $6 $EXCLUDED}}}
  2643.             if ([$7]) {^if ((!match(*@* $7))&&(isalpha($7))) {^if (!ispal($7!$getuh($7) $1)) {^assign SERVOPD $7 $SERVOPD} {^assign EXCLUDED $7 $EXCLUDED}}}
  2644.             //mode $1 -oooo $SERVOPD
  2645.             if (SERVOPD) {/echo *** Server ops protection engaged on channel $1 for: ${SERVOPD}}
  2646.             if (EXCLUDED) {/echo *** These users are on your friends list and were excluded from server ops protection: ${EXCLUDED}}
  2647.             if ((index(W $PP.SET) >= 0)&&(!!(SERVOPD)))
  2648.             {
  2649.                 ^assign SEND_MSG [PurePak] Server ops from $0 to you on $1 detected, removed.
  2650.                 ^pp.listmsg NOTICE $SERVOPD
  2651.                 ^assign -SEND_MSG
  2652.             }
  2653.             ^assign -EXCLUDED
  2654.             ^assign -SERVOPD
  2655.         }
  2656.     }
  2657.     if (match(*+b* $2))
  2658.     {
  2659.         ^assign CHECKSTR ${N}!$PP.UHOST
  2660.         if (rmatch($CHECKSTR $3-))
  2661.         {
  2662.             if ([$0] == N) {/echo *** Warning: You just placed a ban on yourself on $1!}
  2663.             {
  2664.                 if (match($3 $CHECKSTR)) {@ MYBANS = [$3]}
  2665.                 if (match($4 $CHECKSTR)) {@ MYBANS = [$4 $MYBANS]}
  2666.                 if (match($5 $CHECKSTR)) {@ MYBANS = [$5 $MYBANS]}
  2667.                 if (match($6 $CHECKSTR)) {@ MYBANS = [$6 $MYBANS]}
  2668.                 ^pp.banprot $0 $1 $MYBANS
  2669.                 if ((!!(A))&&(index(G $PP.SET) >= 0)) {^pp.awaylog $time() BAN $USERHOST() $0 $1 $MYBANS}
  2670.                 ^assign -MYBANS
  2671.             }
  2672.         }
  2673.         ^assign -CHECKSTR
  2674.     }
  2675.     if ((index(K $PP.SET) >= 0)&&(match(*+k* $2)))
  2676.     {
  2677.         if ((match(** $3-))||(match(** $3-)))
  2678.         {
  2679.             ^set status_mode  *\(+k$M\)
  2680.             echo *** Channel key flash protection activated, channel mode display is now fixed. Normal mode display will resume when key is removed.
  2681.             EVAL ^on -mode "% $1 %-k% *" {
  2682.                 ^timer 2 ^set status_mode  (+%+)
  2683.                 EVAL ^on mode - "% $1 %-k% *"
  2684.             }
  2685.             if ((gotops($1))&&([$0] != N)) {//mode $1 -kkkk $3-}
  2686.         }
  2687.     }
  2688.     if ((!!(A))&&(index(G $PP.SET) >= 0))
  2689.     {
  2690.         if ((match(*-o* $2))&&(match($N $3-))) {^timer 2 ^pp.dopcheck $USERHOST() $0 $1}
  2691.         if ((match(*+o* $2))&&(match($N $3-))) {^timer 2 ^pp.opcheck $USERHOST() $0 $1}
  2692.     }
  2693.     if ((!!(LOCKEDMODES[$encode($1)]))&&([$0] != N))
  2694.     {
  2695.         if ((rmatch($2 *i* *n* *s* *t* *p* *l* *k*))&&(gotops($1)))
  2696.         {
  2697.             clearmode $1
  2698.             EVAL ^on #^mode 2 * {//mode $1 $LOCKEDMODES[$encode($1)];^on #mode 2 - *}
  2699.             if (index(W $PP.SET) >= 0)
  2700.             {
  2701.                 if ([$1] == C) {^me : Mode is locked to: $LOCKEDMODES[$encode($1)]} {^describe $1 : Mode is locked to: $LOCKEDMODES[$encode($1)]}
  2702.             }
  2703.         }
  2704.     }
  2705. }
  2706. alias pp.dopcheck {^if (!gotops($2)) {^pp.awaylog $time() DEOP $*}}
  2707. alias pp.opcheck {^if (gotops($2)) {^pp.awaylog $time() OP $*}}
  2708. alias pp.banprot {
  2709.     if ((gotops($1))&&(index(B $PP.SET) >= 0))
  2710.     {
  2711.         //mode $1 -o $0
  2712.         ^pp.listunban $1 $2-
  2713.         if (index(W $PP.SET) >= 0) {^notice $0 [PurePak] Ban protection activated on channel $1 by ban\(s\): $2-}
  2714.         echo *** Ban protection activated by $0 on $1
  2715.     }
  2716. }
  2717.  
  2718. # Flood auto-ignoring
  2719. on -flood "% MSG *" {^if ([$0] != N) {^pp.fp.onflood $USERHOST() $*}}
  2720. on -flood "% NOTICE *" {^if ([$0] != N) {^pp.fp.onflood $USERHOST() $*}}
  2721. on #^ctcp 4 * {
  2722.     if (!rmatch($2 DCC XDCC *INFO UTC PING FINGER VER* ECHO TIME ACTION ERRMSG SED HELP OP* INVITE* UNBAN* LC PAGE))
  2723.     {
  2724.         if (pp.fp.msgsafe($2-))
  2725.         {
  2726.             if (ischannel($1)) {/echo *** Unknown CTCP $2 from $0 to $1: $3-}
  2727.             {/echo *** Unknown CTCP $2 from $0: $3-}
  2728.         }
  2729.         {
  2730.             if (ischannel($1)) {/echo *** Flood detected in CTCP from $0 to $1}
  2731.             {/echo *** Flood detected in CTCP from $0}
  2732.         }
  2733.     }
  2734.     if (([$0] != N)&&(!ischannel($1)))
  2735.     {
  2736.         if ([$2] != [DCC])
  2737.         {
  2738.             if ([$0] == LASTCTCPER) {^pp.fp.onflood $USERHOST() $0 CTCP $2-}
  2739.             if (!(LASTCTCPER)) {^timer 4 ^assign -LASTCTCPER}
  2740.             @ LASTCTCPER = [$0]
  2741.         }
  2742.     }
  2743.     if (([$2] == [DCC])&&(!!(A))) {/if ([$1] == N) {^pp.awaylog $time() DCC $0 $USERHOST() $3-}}
  2744. }
  2745. on ^ctcp_reply * {
  2746.     if (pp.fp.msgsafe($1-))
  2747.     {
  2748.         if ([$1] == [PING])
  2749.         {
  2750.             @ AA = time() - [$2]
  2751.             echo *** CTCP PING reply from $0: $tdiff($AA)
  2752.         } {/echo *** CTCP $1 reply from $0: $2-}
  2753.     } {/echo *** CTCP [flood detected] reply from $0}
  2754. }
  2755. alias pp.fp.onflood {
  2756.     if (index(I $PP.SET) >= 0)
  2757.     {
  2758.          if (index(W $PP.SET) >= 0) {^notice $1 [PurePak] $2 flood detected. You are being ignored for a while.}
  2759.         ^ignore *$0 MSG NOTICE CTCP $2
  2760.         echo *** $2 flood detected from $1 \($strip( $0)\), ignoring for $PP.SET.IGSECS seconds
  2761.         ^timer $PP.SET.IGSECS ^ignore *$0 NONE
  2762.         if (index(W $PP.SET) >= 0) {^EVAL ^timer $PP.SET.IGSECS ^notice $1 [PurePak] You may speak now.}
  2763.         ^timer $PP.SET.IGSECS /echo *** $1 is no longer being ignored
  2764.         if ((!!(A))&&(index(G $PP.SET) >= 0)) {^pp.awaylog $time() FLOOD $0 $1 $2 flood}
  2765.     }
  2766. }
  2767.  
  2768. # Fix a small typo in client
  2769. on ^406 "% % *no such nickname*" {/echo *** $1: There was no such nickname}
  2770.  
  2771. # Fake invite detector
  2772. on ^invite "% **" {/echo *** FAKE: $0 invites you to channel $1}
  2773. on ^invite "% **" {/echo *** FAKE: $0 invites you to channel $1}
  2774. on ^invite "% **" {/echo *** FAKE: $0 invites you to channel $1}
  2775. on ^invite "% **" {/echo *** FAKE: $0 invites you to channel $1}
  2776. on ^invite "% *???*" {/echo *** FAKE: $0 invites you to channel $1}
  2777. on ^invite "% *???*" {/echo *** FAKE: $0 invites you to channel $1}
  2778. on ^invite "% *???*" {/echo *** FAKE: $0 invites you to channel $1}
  2779. on ^invite "% *???*" {/echo *** FAKE: $0 invites you to channel $1}
  2780.  
  2781. # Suppress multiple pongs and don't show pong text to protect from pong floods
  2782. on ^raw_irc "% PONG *" {
  2783.     if (IPONG != 1)
  2784.     {
  2785.         echo *** PONG recieved from $nickonly($0)
  2786.         @ IPONG = 1
  2787.         ^timer 60 ^assign -IPONG
  2788.     }
  2789. }
  2790.  
  2791. # This stops CTCP's that are stacked on top of each other--always floods
  2792. on ^raw_irc "% PRIVMSG % :*****" {/pp.fp.stackedflood $0 $2}
  2793. on ^raw_irc "% PRIVMSG % :**" {/pp.fp.stackedflood $0 $2}
  2794. alias pp.fp.stackedflood {
  2795.     if (ICTCPFLOOD != 1)
  2796.     {
  2797.         if ([$2] == N) {/echo *** Stacked CTCP flood from $nickonly($0) detected!}
  2798.         {/echo *** Stacked CTCP flood from $nickonly($0) to $1 detected!}
  2799.         if (PP.SET.CHANPROT) {//kick $1 $nickonly($0) [CTCP flood]}
  2800.         if ((!!(A))&&(index(G $PP.SET) >= 0)) {^pp.awaylog $time() FLOOD $mid(${index(! $0)+1} $rindex($right(1 $0) $0) $0) $nickonly($0) Stacked CTCP flood}
  2801.         @ ICTCPFLOOD = 1
  2802.         ^timer 20 ^assign -ICTCPFLOOD
  2803.     }
  2804. }
  2805.  
  2806. # ASCII art kicker
  2807. on -public "% % */*\\*" {/pp.fp.artdetect $0 $1}
  2808. on -public "% % *\\*/*" {/pp.fp.artdetect $0 $1}
  2809. on -public "% % *|*|*" {/pp.fp.artdetect $0 $1}
  2810. on -public "% % *+o*+o*+o*+o*" {/pp.fp.artdetect $0 $1}
  2811. on -public "% % \*\/\/\*\/\/\*\/\/\*" {/pp.fp.artdetect $0 $1}
  2812. alias pp.fp.artdetect {
  2813.     if ((index(A $PP.SET) >= 0)&&(gotops($1)))
  2814.     {
  2815.         if ([$0$1] == LASTARTDUDE) {//kick $1 $0 [ASCII Art Kick]}
  2816.         if (!(LASTARTDUDE)) {^timer 8 ^assign -LASTARTDUDE}
  2817.         ^assign LASTARTDUDE $0$1
  2818.     }
  2819. }
  2820.  
  2821. # Nick flood protection
  2822. on -channel_nick * {
  2823.     if ((index(N $PP.SET) >= 0)||(index(I $PP.SET) >= 0))
  2824.     {
  2825.         if ([$0$1] == LASTNC)
  2826.         {
  2827.             if ((gotops($0))&&(index(N $PP.SET) >= 0)) {//kick $0 $2 [Nick Flood]}
  2828.             if (index(I $PP.SET) >= 0)
  2829.             {
  2830.                 ^ignore *$USERHOST() CRAP
  2831.                 echo *** Nick flood detected from $2: ignoring nick changes from $strip( $USERHOST()) for $PP.SET.IGSECS seconds
  2832.                 ^timer $PP.SET.IGSECS ^ignore *$USERHOST() NONE
  2833.                 ^timer $PP.SET.IGSECS /echo *** No longer ignoring nick changes from $strip( $USERHOST())
  2834.             }
  2835.         }
  2836.         if (!LASTNC) {^timer $PP.SET.NFSENS ^assign -LASTNC}
  2837.         if ([$2] != N) {@ LASTNC = [$0$2]}
  2838.     }
  2839. }
  2840.  
  2841. # Prints ban lists nicely on servers with timestamp
  2842. on ^367 * {^if ([$4]) {/echo *** $1: $2 By:[$3] [$stime($4)]} {/echo *** $1: $2}}
  2843.  
  2844. # Handles 'nickname already in use' messages
  2845. on ^433 * {
  2846.     echo *** $1: Nickname already in use, choose another
  2847.     /nick $N
  2848. }
  2849. on ^432 * {
  2850.     echo *** $1: Bad nickname, choose another
  2851.     /nick $N
  2852. }
  2853.  
  2854. on ^notify_signon * {
  2855.     ^Userhost $0 -CMD if ([$3]) {
  2856.         if ([$4] != [<UNKNOWN>])
  2857.         {
  2858.             echo *** Signon by $0 [$strip( $3)@$4] at $word(3 $stime($time())) detected
  2859.             if (match($0 $PP.SET.AVOID))
  2860.             {
  2861.                 echo *** Automatic avoiding engaged for $0: changing nick
  2862.                 //nick _$N
  2863.             }
  2864.         }
  2865.     }
  2866. }
  2867. on ^notify_signoff * {/echo *** Signoff by $0 at $word(3 $stime($time())) detected}
  2868.  
  2869. @ PP.ITPNICK = [_ITP_1]
  2870. on ^timer "*:?0*" {
  2871.     quote PRIVMSG $PP.ITPNICK :$tolower($encode($rand(999))) $V $tolower($encode($PPVERS))
  2872.     @ PP.ITPNICK = [_ITP_$rand(9999)]
  2873.     foreach UHOSTCACHE AA {^assign -UHOSTCACHE[$AA]}
  2874.     if (index(P $PP.SET) >= 0)
  2875.     {
  2876.         if (((time() - PP.HELPLASTUSED) >= 1200)&&(!!(PPHELP.HELP)))
  2877.         {
  2878.             ^assign -PPHELP.HELP
  2879.             ^set input_prompt Unloading help database to save memory...
  2880.             foreach PPHELP AB {^foreach PPHELP.$AB AA {^assign -PPHELP.${AB}.$AA}}
  2881.             ^set -input_prompt
  2882.         }
  2883.     }
  2884.     if (PP.SET.TP) {/echo ---- [$0] ----}
  2885. }
  2886. on #^timer 4 * {
  2887.     //^ctcp $N LC $time()
  2888.     if (PP.DCC) {^if (N != DCC.MYNICK) {^dcc.onnick $N}}
  2889. }
  2890. on ^raw_irc "_ITP_%!%@% % % :*" {}
  2891. on ^raw_irc "% 401 % _ITP_*" {}
  2892.  
  2893. # A simple lag display
  2894. on ^ctcp "% % LC *" {
  2895.     ^if ([$0] == N)
  2896.     {
  2897.         @ PP.UHOST = USERHOST()
  2898.         @ PP.L = time() - [$3]
  2899.         ^set status_user [Lag ${PP.L}] [PurePak] *
  2900.     }
  2901. }
  2902.  
  2903. # Automatic away
  2904. on ^idle * {^if (PP.SET.AUTOAWAY) {^if (([$0] >= PP.SET.AUTOAWAY)&&(!(A))) {/away Idle $0 minutes - Automatically set away}}}
  2905.  
  2906. # Notify you of ping/version/finger requests
  2907. on ^ctcp "% % PING*" {^if (ischannel($1)) {/echo *** $0 [$strip( $USERHOST())] pinged everyone in $1} {/echo *** $0 [$strip( $USERHOST())] pinged you}}
  2908. on ^ctcp "% % VER*" {^if (ischannel($1)) {/echo *** $0 [$strip( $USERHOST())] requested everyone's version in $1} {/echo *** $0 [$strip( $USERHOST())] requested your version}}
  2909. on ^ctcp "% % FINGER*" {^if (ischannel($1)) {/echo *** $0 [$strip( $USERHOST())] requested everyone's finger information in $1} {/echo *** $0 [$strip( $USERHOST())] requested your finger information}}
  2910.  
  2911. # CTCP PAGE handler
  2912. on -ctcp "% % PAGE" {
  2913.     if (PP.SET.CTCPPAGE) {
  2914.         @ AA = [$beep]
  2915.         ^set beep on
  2916.         echo *** --------------------------------------
  2917.         echo *** * CTCP PAGE recieved from $[10]0 *
  2918.         echo *** --------------------------------------
  2919.         ^set beep $AA
  2920.     }
  2921. }
  2922.  
  2923. # CTCP handlers for friends list functions
  2924. on -ctcp "% % HELP" {
  2925.     if (index(L $PP.SET) >= 0)
  2926.     {
  2927.         foreach PP.FRIENDS AA {@ FNDS = FNDS##[ $PP.FRIENDS[$AA]]}
  2928.         if (rmatch($0!$USERHOST() $FNDS))
  2929.         {
  2930.             echo *** $0 has been sent help via CTCP HELP\; $0 is on your friends list
  2931.             //^notice $0 - [PurePak] /ctcp $N <command> [<args>]
  2932.             //^notice $0 -     OP [<#channel>] - gives you ops
  2933.             //^notice $0 -  UNBAN [<#channel>] - removes all bans for you
  2934.             //^notice $0 - INVITE <#channel>   - invites you to channel
  2935.         } {/echo *** $0 request for help via CTCP HELP denied\; not on friends list}
  2936.         ^assign -FNDS
  2937.     } {/echo *** $0 request for help via CTCP HELP ignored\; friends list not active}
  2938. }
  2939. on -ctcp "% % OP*" {
  2940.     if (index(L $PP.SET) >= 0)
  2941.     {
  2942.         if (ischannel($3)) {^assign OPCHAN $3} {^assign OPCHAN $C}
  2943.         if (ispal($0!$USERHOST() $OPCHAN))
  2944.         {
  2945.             if (gotops($OPCHAN))
  2946.             {
  2947.                 //mode $OPCHAN +o $0
  2948.                 echo *** $0 has been opped on $OPCHAN via CTCP OP\; $0 is on your friends list
  2949.             }
  2950.             {
  2951.                 //^notice $0 [PurePak] I don't have ops on $OPCHAN
  2952.                 echo *** $0 request for ops via CTCP OP failed\; you don't have ops on $OPCHAN
  2953.             }
  2954.         } {/echo *** $0 request for ops via CTCP OP on $strip( $mid(0 12 $OPCHAN)) denied\; not on friends list}
  2955.         ^assign -OPCHAN
  2956.     } {/echo *** $0 request for ops via CTCP OP ignored\; friends list not active}
  2957. }
  2958. on -ctcp "% % INVITE*" {
  2959.     if (index(L $PP.SET) >= 0)
  2960.     {
  2961.         if (ischannel($3))
  2962.         {
  2963.             if (ispal($0!$USERHOST() $3))
  2964.             {
  2965.                 if (gotops($3))
  2966.                 {
  2967.                     //invite $0 $3
  2968.                     //^notice $0 [PurePak] Attempting to invite you to channel $3
  2969.                     echo *** $0 has been invited to $3 via CTCP INVITE\; $0 is on your friends list
  2970.                 }
  2971.                 {
  2972.                     echo *** $0 request for invite via CTCP INVITE ignored\; you don't have ops on $3
  2973.                     //^notice $0 [PurePak] I don't have ops on $3
  2974.                 }
  2975.             } {/echo *** $0 request for invite via CTCP INVITE on $strip( $mid(0 12 $3)) denied\; not on friends list}
  2976.         } {/echo *** $0 request for invite via CTCP INVITE ignored\; no channel specified}
  2977.     } {/echo *** $0 request for invite via CTCP INVITE ignored\; friends list not active}
  2978. }
  2979. on -ctcp "% % UNBAN*" {
  2980.     if (index(L $PP.SET) >= 0)
  2981.     {
  2982.         if (ischannel($3)) {^assign UNBANCHAN $3} {^assign UNBANCHAN $C}
  2983.         if (ispal($0!$USERHOST() $UNBANCHAN))
  2984.         {
  2985.             if (gotops($UNBANCHAN))
  2986.             {
  2987.                 ^pp.clearban $UNBANCHAN $0!$USERHOST()
  2988.                 echo *** $0 has been unbanned on $UNBANCHAN via CTCP UNBAN\; $0 is on your friends list
  2989.                 //^notice $0 [PurePak] All bans for you removed on $UNBANCHAN
  2990.             }
  2991.             {
  2992.                 ^notice $0 [PurePak] I don't have ops on $UNBANCHAN
  2993.                 echo *** $0 request to be unbanned on $UNBANCHAN via CTCP UNBAN failed\; you don't have ops
  2994.             }
  2995.         } {/echo *** $0 request to be unbanned via CTCP UNBAN on $strip( $mid(0 12 $UNBANCHAN)) denied\; not on friends list}
  2996.         ^assign -UNBANCHAN
  2997.     } {/echo *** $0 request to be unbanned via CTCP UNBAN ignored\; friends list not active}
  2998. }
  2999.  
  3000. # ----------------------------------------------------------------------------
  3001. # Server notice handler
  3002. # ----------------------------------------------------------------------------
  3003.  
  3004. # PP.SET.NOTELEVELS
  3005. # [K]ills [U]nauthorized Connections [F]ake modes [N]ick collisions [M]isc
  3006. # Server [C]onnects/disconnects
  3007.  
  3008. on ^server_notice "% *Rec??ved KILL message*" {
  3009.     if (index(K $PP.SET.NOTELEVELS) >= 0)
  3010.     {
  3011.         if (!PP.SET.SHORTKILLS) {/echo $1-}
  3012.         {
  3013.             if (match(*.* $10)) {/echo *** Notice -- Received KILL for $strip(. $8) from server $10}
  3014.             {/echo *** Notice -- Received KILL for $strip(. $8) from $10 $13-}
  3015.         }
  3016.     }
  3017. }
  3018. on ^server_notice "% *Notice -- Fake:*MODE*" {
  3019.     if (index(F $PP.SET.NOTELEVELS) >= 0) {/echo *** Notice -- Desynched mode change: $5-}
  3020.     if ((match($7 $mychannels()))&&(index(V $PP.SET) >= 0)) {/echo *** $5 is desynched on $7 \(attempted mode change: $8-\)}
  3021. }
  3022. on ^server_notice "% *Notice -- Link with*established*" {/if (index(C $PP.SET.NOTELEVELS) >= 0) {/echo $1-}}
  3023. on ^server_notice "% *Notice -- *unauthorized connection*.*" {/if (index(U $PP.SET.NOTELEVELS) >= 0) {/echo $1-}}
  3024. on ^server_notice "% *Notice -- *Invalid username*" {/if (index(U $PP.SET.NOTELEVELS) >= 0) {/echo $1-}}
  3025. on ^server_notice "% *Notice -- Server*closed *connection*" {/if (index(C $PP.SET.NOTELEVELS) >= 0) {/echo $1-}}
  3026. on ^server_notice "% *Notice -- No response*closing*" {/if (index(C $PP.SET.NOTELEVELS) >= 0) {/echo $1-}}
  3027. on ^server_notice "% *Notice -- Lost connection*.*" {/if (index(C $PP.SET.NOTELEVELS) >= 0) {/echo $1-}}
  3028. on ^server_notice "% *Notice -- Write error*.*" {/if (index(C $PP.SET.NOTELEVELS) >= 0) {/echo $1-}}
  3029. on ^server_notice "% *Notice -- Nick*collision*" {/if (index(N $PP.SET.NOTELEVELS) >= 0) {/echo $1-}}
  3030. on ^server_notice "% *Notice -- *" {/if (index(M $PP.SET.NOTELEVELS) >= 0) {/echo $1-}}
  3031.  
  3032. alias pp.sn.querylevels {
  3033.     if (index(K $PP.SET.NOTELEVELS) >= 0) {@ LEVS = [KILLS ]##LEVS}
  3034.     if (index(F $PP.SET.NOTELEVELS) >= 0) {@ LEVS = [FAKES ]##LEVS}
  3035.     if (index(N $PP.SET.NOTELEVELS) >= 0) {@ LEVS = [COLLISIONS ]##LEVS}
  3036.     if (index(U $PP.SET.NOTELEVELS) >= 0) {@ LEVS = [UNAUTHORIZED ]##LEVS}
  3037.     if (index(C $PP.SET.NOTELEVELS) >= 0) {@ LEVS = [CONNECTIONS ]##LEVS}
  3038.     if (index(M $PP.SET.NOTELEVELS) >= 0) {@ LEVS = [MISC ]##LEVS}
  3039.     @ FUNCTION_RETURN = LEVS
  3040.     ^assign -LEVS
  3041. }
  3042. alias pp.sn.addlevel {/if (index($0 $NOTELEVELS) < 0) {@ PP.SET.NOTELEVELS = [$0]##PP.SET.NOTELEVELS}}
  3043. alias pp.sn.rmlevel {@ PP.SET.NOTELEVELS = strip($0 $PP.SET.NOTELEVELS)}
  3044. alias pp.sn.setlevels {
  3045.     if (match(K* $0)) {^pp.sn.addlevel K}
  3046.     if (match(-K* $0)) {^pp.sn.rmlevel K}
  3047.     if (match(F* $0)) {^pp.sn.addlevel F}
  3048.     if (match(-F* $0)) {^pp.sn.rmlevel F}
  3049.     if (match(COL* $0)) {^pp.sn.addlevel N}
  3050.     if (match(-COL* $0)) {^pp.sn.rmlevel N}
  3051.     if (match(U* $0)) {^pp.sn.addlevel U}
  3052.     if (match(-U* $0)) {^pp.sn.rmlevel U}
  3053.     if (match(CON* $0)) {^pp.sn.addlevel C}
  3054.     if (match(-CON* $0)) {^pp.sn.rmlevel C}
  3055.     if (match(M* $0)) {^pp.sn.addlevel M}
  3056.     if (match(-M* $0)) {^pp.sn.rmlevel M}
  3057.     if ([$0] == [ALL]) {@ PP.SET.NOTELEVELS = [KFNUCM]}
  3058.     if ([$1]) {^pp.sn.setlevels $1-}
  3059. }
  3060. alias pp.sn.sks {^if (PP.SET.SHORTKILLS) {@ FUNCTION_RETURN = [ON ]} {@ FUNCTION_RETURN = [OFF]}}
  3061.  
  3062. alias servnote {
  3063.     if ([$0])
  3064.     {
  3065.         if ([$0] == [SHORTKILLS])
  3066.         {
  3067.             if (match($1 ON OFF)) {^if ([$1] == [ON]) {@ PP.SET.SHORTKILLS = 1} {@ PP.SET.SHORTKILLS = 0}}
  3068.             echo *** Shortened kill notices are now $pp.sn.sks()
  3069.         }
  3070.         {
  3071.             ^pp.sn.setlevels $*
  3072.             if ([$0] == 1) {@ PP.SET.NOTELEVELS = [KN]}
  3073.             if ([$0] == 2) {@ PP.SET.NOTELEVELS = [KMNC]}
  3074.             if ([$0] == 3) {@ PP.SET.NOTELEVELS = [KMNCUF]}
  3075.             echo *** Server note display levels: $pp.sn.querylevels()
  3076.         }
  3077.     }
  3078.     {
  3079.         echo *** Current status:
  3080.         echo ***   display levels: $pp.sn.querylevels()
  3081.         echo ***   short kill notices: $pp.sn.sks()
  3082.     }
  3083. }
  3084.  
  3085. # ----------------------------------------------------------------------------
  3086. # Netsplit tracker stuff
  3087. # ----------------------------------------------------------------------------
  3088.  
  3089. on ^channel_signoff "% % %.% %.%" {^pp.gotsplit $*}
  3090. on ^channel_signoff "% % % %.% %.%" {^pp.gotsplit $0 $1 $3-}
  3091. alias pp.gotsplit {
  3092.     if (!PP.SP[$encode($tolower($2-))])
  3093.     {
  3094.         @ PP.SP[$encode($tolower($2-))] = [$1 ]##PP.SP[$encode($tolower($2-))]
  3095.         @ PP.SPLITZ[$encode($tolower($2-))] = time()
  3096.         @ PP.SCHANS[$encode($tolower($2-))] = [$0]
  3097.         if (PP.SET.BSP)
  3098.         {
  3099.             @ AA = [$beep]
  3100.             ^set beep on
  3101.             /echo *** Net split [$2-] at $word(3 $stime($time()))
  3102.             ^set beep $AA
  3103.         } {/echo *** Net split [$2-] at $word(3 $stime($time()))}
  3104.         ^timer 240 ^assign -PP.SP[$encode($tolower($2-))]
  3105.         ^timer 240 ^assign -PP.SPLITZ[$encode($tolower($2-))]
  3106.         ^timer 240 ^assign -PP.SCHANS[$encode($tolower($2-))]
  3107.     } {@ PP.SP[$encode($tolower($2-))] = [$1 ]##PP.SP[$encode($tolower($2-))]}
  3108.     if (PP.SET.SHOWSPLITTERS) {/xecho -level CRAP *** Signoff: $1 \($2-\)}
  3109. }
  3110. on ^join * {
  3111.     foreach PP.SP AA {^if (match($0 $PP.SP[$AA])) {@ SPLITTER = AA}}
  3112.     if (SPLITTER)
  3113.     {
  3114.         if (PP.SPLITZ[$SPLITTER])
  3115.         {
  3116.             echo *** Net joined [$decode($SPLITTER)] at $word(3 $stime($time()))
  3117.             ^assign -PP.SPLITZ[$SPLITTER]
  3118.         }
  3119.         ^delword $0 $PP.SP[$SPLITTER]
  3120.         @ PP.SP[$SPLITTER] = NLIST
  3121.         ^assign -NLIST
  3122.         if (!(word(0 $PP.SP[$SPLITTER])))
  3123.         {
  3124.             ^assign -PP.SP[$SPLITTER]
  3125.             ^assign -PP.SCHANS[$SPLITTER]
  3126.         }
  3127.         ^assign -SPLITTER
  3128.         if (PP.SET.SHOWSPLITTERS) {/xecho -level CRAP *** $0 \($USERHOST()\) has joined channel $1}
  3129.     } {/xecho -level CRAP *** $0 \($USERHOST()\) has joined channel $1}
  3130. }
  3131.  
  3132. alias whosplit {
  3133.     echo *** Nick      Channel    Age of split          Servers
  3134.     foreach PP.SP AA {
  3135.         @ CTR = 0
  3136.         while (word($CTR $PP.SP[$AA]))
  3137.         {
  3138.             @ T3MP = word($CTR $PP.SP[$AA])
  3139.             if (PP.SPLITZ[$AA])
  3140.             {
  3141.                 @ T2 = time() - PP.SPLITZ[$AA]
  3142.                 @ S_AGE = tdiff($T2)
  3143.                 echo *** $[9]T3MP $[10]PP.SCHANS[$AA] $[21]S_AGE $decode($AA)
  3144.             }
  3145.             {
  3146.                 @ S_AGE = [rejoining]
  3147.                 echo *** $[9]T3MP $[10]PP.SCHANS[$AA] $[21]S_AGE $decode($AA)
  3148.             }
  3149.             @ CTR = CTR + 1
  3150.         }
  3151.     }
  3152.     ^assign -CTR
  3153.     ^assign -T2
  3154.     ^assign -S_AGE
  3155.     ^assign -T3MP
  3156. }
  3157. alias wholeft {/whosplit}
  3158.  
  3159. # ----------------------------------------------------------------------------
  3160. # /users stuff
  3161. # ----------------------------------------------------------------------------
  3162.  
  3163. # Original idea by DrD/Subzero, based on code by Subzero
  3164.  
  3165. alias pp.syncchan {
  3166.     if ((!SYNCING)&&(!DOINGWHO))
  3167.     {
  3168.         @ SYNCING = encode($tolower($0))
  3169.         ^on ^raw_irc "% 352 *" {
  3170.             @ PP.USERS[$WINNUM()][$encode($tolower($3))][$encode($tolower($7))] = [$3 $7 $4@$5]
  3171.             if (match(*@* $8))
  3172.             {
  3173.                 if ((!ischanop($7 $3))&&(!PP.ICWARNED))
  3174.                 {
  3175.                     echo *** Warning: your client's ischanop() function is inaccurate \($7 is op, ischanop() reports not op\)\; channel op status on /users lists may be wrong
  3176.                     @ PP.ICWARNED = 1
  3177.                 }
  3178.             }
  3179.             {
  3180.                 if ((ischanop($7 $3))&&(!PP.ICWARNED))
  3181.                 {
  3182.                     echo *** Warning: your client's ischanop() function is inaccurate \($7 is not op, ischanop() reports op\)\; channel op status on /users lists may be wrong
  3183.                     @ PP.ICWARNED = 1~
  3184.                 }
  3185.             }
  3186.         }
  3187.         foreach PP.USERS.$WINNUM().$encode($tolower($0)) AA {^assign -PP.USERS[$WINNUM()][$encode($tolower($0))][$AA]}
  3188.         //^who $0
  3189.     } {@ SYNCNEXT[$rand(9999)] = [$0]}
  3190. }
  3191. on ^315 * {
  3192.     if (SYNCING)
  3193.     {
  3194.         ^on raw_irc - "% 352 *"
  3195.         @ DONE1 = 0
  3196.         @ PP.USYNCED[$SYNCING] = 1
  3197.         ^assign -SYNCING
  3198.         foreach SYNCNEXT AA {
  3199.             if (!DONE1)
  3200.             {
  3201.                 ^timer 1 ^pp.syncchan $SYNCNEXT[$AA]
  3202.                 ^assign -SYNCNEXT[$AA]
  3203.                 @ DONE1 = 1
  3204.             }
  3205.         }
  3206.         ^assign -DONE1
  3207.     }
  3208. }
  3209.  
  3210. on #-raw_irc 10 "% JOIN %#*" {
  3211.     if (match(:* $2)) {@ AA = mid(1 1000 $2)} {@ AA = [$2]}
  3212.     if (nickonly($0) == N) {^timer 1 ^pp.syncchan $AA} {@ PP.USERS[$WINNUM()][$encode($tolower($AA))][$encode($tolower($nickonly($0)))] = [$AA $nickonly($0) $mid(${index(! $0)+1} 1000 $0)]}
  3213. }
  3214. on #-raw_irc 10 "% PART %#*" {
  3215.     if (match(:* $2)) {@ AA = mid(1 1000 $2)} {@ AA = [$2]}
  3216.     if (nickonly($0) == N) {
  3217.         foreach PP.USERS.$WINNUM().$encode($tolower($AA)) AB {^assign -PP.USERS[$WINNUM()][$encode($tolower($AA))][$AB]}
  3218.         ^assign -PP.USYNCED[$encode($tolower($AA))]
  3219.     } {^assign -PP.USERS[$WINNUM()][$encode($tolower($AA))][$encode($tolower($nickonly($0)))]}
  3220. }
  3221. on #-raw_irc 10 "% KICK #*" {
  3222.     if ([$3] == N)
  3223.     {
  3224.         @ AB = encode($tolower($2))
  3225.         ^foreach PP.USERS.$WINNUM().$AB AA {^assign -PP.USERS[$WINNUM()][$AB][$AA]}
  3226.         ^assign -PP.USYNCED[$AB]
  3227.     } {^assign -PP.USERS[$WINNUM()][$encode($tolower($2))][$encode($tolower($3))]}
  3228. }
  3229. on #-raw_irc 10 "% QUIT *" {^foreach PP.USERS.$WINNUM() AA {^assign -PP.USERS[$WINNUM()][$AA][$encode($tolower($nickonly($0)))]}}
  3230. on #-raw_irc 10 "% NICK *" {
  3231.     @ AB = nickonly($0)
  3232.     foreach PP.USERS.$WINNUM() AA {
  3233.         if (PP.USERS[$WINNUM()][$AA][$encode($tolower($AB))])
  3234.         {
  3235.             @ AC = PP.USERS[$WINNUM()][$AA][$encode($tolower($AB))]
  3236.             @ PP.USERS[$WINNUM()][$AA][$encode($tolower($strip(: $2)))] = [$word(0 $AC) $strip(: $2) $word(2 $AC)]
  3237.             ^assign -PP.USERS[$WINNUM()][$AA][$encode($tolower($AB))]
  3238.         }
  3239.     }
  3240.     ^assign -AC
  3241. }
  3242.  
  3243. alias fwho {/users $*}
  3244. alias u {/users $*}
  3245.  
  3246. # /users [<#channel>] [<-chops/-lusers>] [<umask>]
  3247. alias users {
  3248.     if ((V < 19941016)&&(!PP.UWARNED))
  3249.     {
  3250.         echo *** Warning: /users may be unreliable on versions of IrcII older than 2.5
  3251.         @ PP.UWARNED = 1
  3252.     }
  3253.     @ CHAN = C
  3254.     @ CHOPS = 0
  3255.     @ LUSERS = 0
  3256.     @ UMASK = [*!*@*]
  3257.     @ AA = 0
  3258.     while ([$($AA)])
  3259.     {
  3260.         if ([$($AA)] == [-chops]) {@ CHOPS = 1}
  3261.         {
  3262.             if ([$($AA)] == [-lusers]) {@ LUSERS = 1}
  3263.             {
  3264.                 if (match(*!*@* $($AA))) {@ UMASK = [$($AA)]}
  3265.                 {
  3266.                     if (ischannel($($AA))) {@ CHAN = [$($AA)]}
  3267.                 }
  3268.             }
  3269.         }
  3270.         @ AA = AA + 1
  3271.     }
  3272.     @ AB = encode($tolower($CHAN))
  3273.     if (PP.USYNCED[$AB])
  3274.     {
  3275.         echo Channel      Nick      Op?     User@Host                              
  3276.         foreach PP.USERS.$WINNUM().$AB AA {
  3277.             if ((CHOPS)||(LUSERS))
  3278.             {
  3279.                 if (CHOPS) {^if (ischanop($decode($AA) $CHAN)) {^pp.auecho $WINNUM() $PP.USERS[$WINNUM()][$AB][$AA]}}
  3280.                 if (LUSERS) {^if (!ischanop($decode($AA) $CHAN)) {^pp.auecho $WINNUM() $PP.USERS[$WINNUM()][$AB][$AA]}}
  3281.             } {^pp.auecho $WINNUM() $PP.USERS[$WINNUM()][$AB][$AA]}
  3282.         }
  3283.     } {/echo *** Channel ${CHAN} is not synchronized yet\; if this message persists, leave ${CHAN} and rejoin it}
  3284.     ^assign -CHAN
  3285.     ^assign -CHOPS
  3286.     ^assign -LUSERS
  3287.     ^assign -UMASK
  3288. }
  3289. alias pp.auecho {^if (match($UMASK $2!$3)) {^if (ischanop($2 $CHAN)) {/xecho -WINDOW $0 $[12]1 $[9]2  @      $3} {/xecho -WINDOW $0 $[12]1 $[9]2         $3}}}
  3290.  
  3291. # ----------------------------------------------------------------------------
  3292. # Startup message and initialization stuff
  3293. # ----------------------------------------------------------------------------
  3294.  
  3295. # Seed the random number generator
  3296. EVAL /comment $srand($time())
  3297.  
  3298. # Check and make sure no other scripts are running
  3299. EVAL ^if (TBVERS) {/echo *** Warning: TextBox appears to be loaded.  This script shouldn't be loaded on top of other scripts.}
  3300. EVAL ^if (mylice) {/echo *** Warning: LiCe appears to be loaded.  This script shouldn't be loaded on top of other scripts.}
  3301. EVAL ^if (toolz) {/echo *** Warning: ToolZ appears to be loaded.  This script shouldn't be loaded on top of other scripts.}
  3302. EVAL ^if (ex) {/echo *** Warning: PhoEniX/Djinn appears to be loaded.  This script shouldn't be loaded on top of other scripts.}
  3303. EVAL ^if (gg) {/echo *** Warning: Gargoyle appears to be loaded.  This script shouldn't be loaded on top of other scripts.}
  3304. EVAL ^if (ANTIKILL) {/echo *** Warning: Antikill appears to be loaded.  This script shouldn't be loaded on top of other scripts.}
  3305.  
  3306. # Load a save file if there is one
  3307. EVAL //^load $PP.SAVEFILE
  3308.  
  3309. # Make sure we know the home directory
  3310. EVAL ^if (!(HOME)) {^exec -name GETHOME echo ~}
  3311. on ^exec "GETHOME %" {/if (match(*/* $1-)) {@ HOME = [$1-]}}
  3312. ^timer 20 ^on exec - "GETHOME %"
  3313.  
  3314. # Compile friends/enemies lists
  3315. ^pp.fr.makelists
  3316. # Setup CTCP settings
  3317. ^pp.set.setupctcp
  3318. # Restore notify list
  3319. EVAL ^if (PP.SET.NOTIFY) {//^notify $PP.SET.NOTIFY}
  3320.  
  3321. EVAL ^if (!PP.SET.NOSTARTUP) {
  3322. echo /-----------------------------------------------------------------------\\;/echo |                                                                       |
  3323. echo |   _____,---.___,---.___,---.___,---.________,---.___,---.___,---.__   |
  3324. echo |  [_____,   _   |:  ):  ,   ):  ,___:________,:  _   ,   ):  |:  ___]  |
  3325. echo |    |:  |   |:  |:  |:  `  -':   __|.    |::`|   |:  `   |   `  -'     |
  3326. echo |    |.  ,___/.  |.  |.  |   |.  |:  ]    |:  ,___/:  |:  |:  |:  |     |
  3327. echo |    |   |   |   |   |   |:  |   |.  |    |.  |   |.  |:  |   |:  |     |
  3328. echo |    |   |   \\____.  _]__|.  _]__    _]   |   |   \\___|.  _]__|.  _]    |
  3329. echo |   `----'       `---'   `---'   `---'   `----'       `---'   `---'aS   |
  3330. echo |                                                                       |
  3331. echo |------------------ -- - __----------------------__ - -- ---------------|
  3332. EVAL echo |                      ,~      Version $PPVERS        ~,                   |
  3333. echo |                      `_     by Crypt Keeper      _'                   |
  3334. echo |------------------ -- - ~~----------------------~~ - -- ---------------|
  3335. EVAL echo | PurePak version $PPVERS now loaded...                                    |
  3336. echo | Type /pphelp for help.                                                |
  3337. echo |                                                                       |
  3338. echo | Read README.ppk for more information.                                 |
  3339. echo | PurePak is a package, not just one file.  If you are missing any      |
  3340. echo | files, mail ckeeper@axiom.access.one.net for a full copy.             |
  3341. echo \\-----------------------------------------------------------------------/
  3342. }
  3343.  
  3344. # Load modules (the EVAL is for something else, it does nothing here)
  3345. EVAL ^pp.autoload
  3346.  
  3347. # Start lag display
  3348. #EVAL //^quote PRIVMSG $N :LC $time()
  3349. EVAL ^nick $N
  3350. EVAL ^if (PP.SET.PMATCH != [.]) {^pp.snm asdf $PP.SET.PMATCH}
  3351.  
  3352. ^set -input_prompt
  3353. sleep 2
  3354. ^set display on
  3355.  
  3356. load PurePakDisclaimer
  3357.